3

I have a domain I want to point to my github pages site. However, I want to keep the subdomain old.mysite.com pointing at the current server (as this is an archive of my old php blog, which github pages can't host).

How would I go about doing this (Ideally using the tools available in cPanel)?

wheresrhys
  • 181
  • 1
  • 9
  • Remember, any links that used to point to your old blog will become dead (or at least show up as 404s on the new GitHub blog). – IQAndreas Mar 03 '14 at 05:54
  • If this is an issue, GitHub does not have a way of redirecting from the server side, but you can set up HTTP redirects using some manual work. – IQAndreas Mar 03 '14 at 05:55

1 Answers1

5

You can create the following DNS records:

www.mysite.com  CNAME  youruser.github.io
old.mysite.com  A      ip.address.of.your.server

Given that you can't have a CNAME on the bare domain (mysite.com) you should point it to your server and make it a redirect to www.mysite.com on the http level. GitHub can also take care of the redirect for you, but I would avoid doing that as you will need to keep the A record up-to-date yourself (ALIAS records are rare). See the GitHub docs

Dennis Kaarsemaker
  • 19,277
  • 2
  • 44
  • 70
  • perfect - thanks. For anyone who is using cPanel the ability to set this is found under 'Advanced DNS zone editor' – wheresrhys Mar 02 '14 at 19:51