10

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.

1 Answer 1

13

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

7
  • Thank you. I have created the CNAME page but I can't work out the setting up DNS part. Am I supposed to type this into the git command line? Feb 16, 2013 at 9:19
  • the dns settings would be entered in your dns providers website Feb 16, 2013 at 9:21
  • eg. something like godaddy, namecheap etc, you do have a dns provider dont you? Feb 16, 2013 at 9:27
  • Ok, I think I worked it out. I have changed the dns settings with the company I registered the domain with. Feb 16, 2013 at 9:33
  • I changed the two A entries for ww and @, but left the MX ones unchanged. Is that right? Feb 16, 2013 at 9:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.