Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up GitHub Pages to look for index.html in a different location?

Just set up my GitHub Pages website and as far as I can tell, GitHub Pages will look for index.html in the parent directory (i.e. if my repo is in username.github.io, it will look for index.html in username.github.io/index.html).

If it cannot find index.html there, it renders out my README.md on the page instead.

Must the index.html file go there or is there a way to tell Pages to look for that file in let's say username.github.io/src/index.html?

like image 924
jzybert Avatar asked Mar 22 '17 01:03

jzybert


People also ask

Can I have my GitHub Pages index html in a subfolder of the repository?

Try transferring your index. html file and all its dependencies into a new repository and then use that repository as a sub-module in you current repository. Currently GitHub Pages expects to find an index.

How do I add index html to GitHub?

In your repo page and file-listing, click through index. html and click the Edit button, which will let you edit index. html via the Github file editor. Commit your changes.

Why does my website look different on GitHub Pages?

It appears to be a mixed-content error. Since GitHub Pages are served over HTTPS, you have to make sure that when requesting external resources they're also served over HTTPS. In your index. html file change the http in http://code.jquery.com/jquery-3.5.1.min.js to https and you should be good to go!


1 Answers

You can try this: create a dummy index.html file at the root, and insert this line of code and give it the right path.

index.html

<meta http-equiv="refresh" content="0; url=https://yourname.github.io/myapplication/frontend/public/index.html" />
like image 82
Morris S Avatar answered Sep 26 '22 06:09

Morris S