Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set a custom 404 page on GitHub Pages? [closed]

I am trying to set a custom 404 page on Github Pages.

I have created a page here: http://garemoko.github.com/TinCanCoUK/404.html which works when visited directly.

However, if I go to http://garemoko.github.com/TinCanCoUK/foo.html I get the default Github 404 page.

Any ideas? I have the 404.html in both master and gh-pages directories.

Background: This is particularly important for this site as I am moving from a mediawiki site that uses : in the urls which I can't replicate so I'm having to change all my URLs.

like image 645
Andrew Downes Avatar asked Feb 16 '13 08:02

Andrew Downes


1 Answers

Looks like this only works if you use a custom domain

https://help.github.com/articles/custom-404-pages

Good to know: custom 404s only work when they are served from the root of a Pages domain, for example a project using a custom domain or a user pages repo. A custom 404 page on project pages that are not using a custom domain will not work.

See this for setting up custom domains

like image 104
Daniel Powell Avatar answered Oct 29 '22 02:10

Daniel Powell