Friday, September 11, 2009

Subdomains on Github

I've been using Github for a while, and it didn't really occur to me to write about it. It's just something that I assume everyone uses, but don't talk much about. Like toilet paper.

But I just discovered some two-ply goodness that I had to share. Github link juice; or more correctly - instant SEO credibility by owning a github subdomain. If you visit, you'll be redirected to this site. But how?

There are two way of going about it. If you visit a subdomain that hasn't been used you'll get this page:
Try it:

That's most of the trick. Create a new public repository (don't worry, it's free) of "" (don't forget the " part). Add an index.html file and push to master. Viola.

(for you non-git people, when you create the repository, github gives you clearer instructions than I could here)

But there's more. To do a simple redirect, just paste in some html with a meta refresh tag, or to keep the nice subdomain url to mask your GeoCities site (look it up, kids) - just upload a page with a blank iframe, which contains your site.
<iframe src="" width="100%" height="100%"
style="border:0px" marginheight="0" marginwidth="0" frameborder="0">
<a href="">Coderoshi - Death By Overcoding</a>

But there's more! If you don't want something so sloppy, and merely want a URL redirect to your site, instead of an index.html file, upload a file named CNAME, which contains your domain. Mine looks like this:
That's it! Instant credibility from google (you're a real subdomain of the very popular domain).

No comments: