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)?

2
  • 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 3, 2014 at 5: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 3, 2014 at 5:55

1 Answer 1

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

1
  • perfect - thanks. For anyone who is using cPanel the ability to set this is found under 'Advanced DNS zone editor'
    – wheresrhys
    Mar 2, 2014 at 19:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .