3

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.

4
  • 2
    That URL redirects to http://gabrielecirulli.github.com/2048/ which itself is another redirect.
    – Wooble
    Apr 28, 2014 at 20:13
  • So you want to use git.io to link to a place that git.io explicitly says you can't use their service link to? What does the first part of the question have to do with the second?
    – David
    Apr 28, 2014 at 20:36
  • @David git.io/2048 does the trick. I just want to know how.
    – Excalibur
    Apr 29, 2014 at 23:33
  • You want to know how... a URL redirect works?
    – David
    Apr 30, 2014 at 17:03

2 Answers 2

4

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
2

Use your normal github.io address but change the ".io" to ".com" (e.g. gabrielecirulli.github.io/2048/ would be entered as gabrielecirulli.github.com/2048/).

Here's an article about the githup pages that explain the github.io vs githum.com relation as well: https://github.com/blog/1452-new-github-pages-domain-github-io

1
  • That explains how the 2048 link works, but it only applies to old GitHub Pages sites that precede the switch from .github.com to .github.io. If you try to access new GitHub Pages sites under .github.com, you get a 404 page saying: "Subdomains of github.com are deprecated for GitHub Pages. They will not redirect to github.io for new GitHub Pages sites." Apr 12, 2020 at 18:33

Your Answer

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