2

I'm hosting a project page on github at somedude.github.io/thingeroo and I own the thingeroo.com domain name (through 1&1.com).

I know that I can set up a CNAME to point from thingeroo.com to somedude.github.io, but can I somehow point to somedude.github.io/thingeroo? If I can’t do this through CNAME entries—and it seems that this is the case—can I do it through some other means?

2 Answers 2

2

If you want thingeroo.com to point to somedude.github.io/thingeroo then this would require github, in this case, to cooperate by acting as a proxy. Fortunately github actually does this! All you have to do is:

  1. Specify an A Record for thingeroo.com that points to the appropriate github server (192.30.252.154 or 192.30.252.153)
  2. Add a CNAME file in your github repo's gh-pages branch with the contents thingeroo.com. This latter step is what allows github to know where to send the requests.

More details on this StackOverflow answer.

1

CNAME records don't have anything to do with redirecting HTTP requests. They're for host names. You can't use a CNAME record for this purpose.

Fortunately, almost all domain registrars provide a service that will allow you to redirect requests to your domain to somewhere else. They do this by setting your DNS A records to their web servers where a lightweight application receives the request, inspects the Host header, and then redirects the browser to a URL elsewhere.

You can usually find a setting for this on your registrar's control panel, around the same place you find parking pages.

5
  • This topic is foreign to me so I'm having trouble figuring out what to google to get the answers I want. Any tips? Commented Nov 17, 2014 at 0:41
  • Oh... and just to be sure. I don't actually want to do and HTTP redirect. I want users to visit thingeroo.com and see my blog. I don't want them to visit thingeroo.com and be redirected to somedude.github.io/thingeroo. Commented Nov 17, 2014 at 0:44
  • @JohnBerryman That isn't directly possible. That would require GitHub to support such functionality. The only thing you could do would be to set up a proxy server that rewrites all of the URLs and links in markup.
    – Brad
    Commented Nov 17, 2014 at 1:33
  • You are correct, but also github does server as a proxy - so it works out. I'll post another answer. Commented Nov 17, 2014 at 5:19
  • @JohnBerryman I realize you figured out GitHub can handle this, but most hosting services offer basic URL redirection services from their control panel in which you can assign a redirect URL for a domain name and that URL can be whatever you want. CNAME and A name records only have to do with the host of the URL, somedude.github.io. Anthging to the right of the hostname is handled by a web server via HTTP processes. Commented Nov 17, 2014 at 5:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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