DEV Community

Ajay Dhangar
Ajay Dhangar

Posted on

Web hosting issues || GitHub Page is not showing up on website?

I have created one repository on GitHub and hosted it with the help of the GitHub page. My issue is that if I have put all code (CSS, JavaScript code) in HTML then it works, but if I have created another folder of CSS and JavaScript, and saved the path in HTML, then it's not working. I don't understand why.

For example, you create one simple hello world website and try code from this condition.

Repository link: Aj Zero Coding

Website link: Aj Zero Coding

Output link: Project (I want this output).

Top comments (3)

Collapse
 
cicirello profile image
Vincent A. Cicirello • Edited

The URL to that site is ajay-dhangar.github.io/Aj-Zero-Cod..., so all of your paths that start with a / are based on the root of your GitHub Pages URL, ajay-dhangar.github.io/ rather than what you intend as the root of that site.

Collapse
 
aneshodza profile image
anes

I believe it is because your paths are specified as /path/to/file. That goes our form root. GitHub Pages may have another root path than you locally, so you should change the paths into ./path/to/file. Hope that helps!

Collapse
 
ajaydhangar49 profile image
Ajay Dhangar • Edited

Thanks for helping me.
I have understanded ./folder/subfolder/file OR ./file this is right path.
code is 100% work.