How to use git.io for non github.com domain URL

github

If you enter an URL that is not under github.com domain, git.io will warn you that URL must be from github.com.

However http://git.io/2048 goes to https://gabrielecirulli.github.io/2048/. I tried my own Github Pages and it didn't work.

Best Answer

One more thing to note here, besides changing .io to .com is that if you create a short URL for a GitHub URL without providing a custom code argument, you won't be able to use Git.io to shorten the same GitHub URL again with your custom code.

For instance I shortened https://1oh1.github.com using the Git.io website without providing a custom code, so now I'm stuck with this: http://git.io/hWhKbw

However, I used curl to shorten the same URL again (this time without the "S" in "HTTPS" so it's a different URL) and provided a "code" argument:

curl http://git.io/ -i -F "url=http://1oh1.github.com" -F "code=1oh1"

That got me what I wanted:

HTTP/1.1 100 Continue

HTTP/1.1 201 Created
Server: GitHub.com
Date: Wed, 17 Sep 2014 08:30:39 GMT
Content-Type: text/html;charset=utf-8
Connection: keep-alive
Status: 201 Created
Location: http://git.io/1oh1
Content-Length: 23
X-Runtime: 0.008799
X-Node: gitio2