IssueRaiser

Add single page application support for Github pages

As github pages does not support server side configuration (for example .htaccess files), it is impossible to get url rewriting to the index page working for a single page application. Ideally, there should be a .gh-pages.yml or similar file in the repo root that has certain flags like ``` yml redirects: redirect_to: index.html try_files: true ``` The above would be the equivalent of the following for nginx ``` location / { root /path/to/site; index index.html; try_files $uri $uri/ /index.html =404; } ``` The workaround is to use a hashbang like in [angularjs html5 mode](https://docs.angularjs.org/guide/$location#hashbang-and-html5-modes) but this is fairly unsightly. I think this feature is much wanted in the angular js community, and any other frontend javascript framework that supports the HTML5 History API.

Posted by zakhenry on Jun 13, 2015, 12:35 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.6,000 issues0 comments

support (Sysadmin)

Add single page application support for Github pages

zakhenryJun 13, 2015, 12:35 PM

As github pages does not support server side configuration (for example .htaccess files), it is impossible to get url rewriting to the index page working for a single page application. Ideally, there should be a .gh-pages.yml or similar file in the repo root that has certain flags like ``` yml redirects: redirect_to: index.html try_files: true ``` The above would be the equivalent of the following for nginx ``` location / { root /path/to/site; index index.html; try_files $uri $uri/ /index.html =404; } ``` The workaround is to use a hashbang like in [angularjs html5 mode](https://docs.angularjs.org/guide/$location#hashbang-and-html5-modes) but this is fairly unsightly. I think this feature is much wanted in the angular js community, and any other frontend javascript framework that supports the HTML5 History API.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue