Tiagojdferreira
Tiagojdferreira

Reputation: 1122

Use other than index.html for Github pages

I have recently started using github pages and so far I am using the default index.html as my main page. How do I use another page as my default page? For example if in my gh-pages branch I have my html in a folder src/. How do I set ./src/index.html as my default instead of ./index.html?

Upvotes: 9

Views: 4948

Answers (2)

Laurenz
Laurenz

Reputation: 1960

I though Steven Penny's comment was good, but on Windows it was not super straightforward to create a symlink inside git. Only more recent versions of git-for-windows support symlinks.

If you enable support via the core.symlinks config variable you can mklink index.html src\file.html and gh-pages will show file.html as the landing page.

Upvotes: 0

Dmitry Shilyaev
Dmitry Shilyaev

Reputation: 733

Create dummy index.html and put this in the header

<meta http-equiv="refresh" content="0; url=http://mysite.github.io/folder/index.html" />

Change http://mysite.github.io/folder/index.html to your desired url.

Upvotes: 5

Related Questions