LoginSignup
8
8

More than 5 years have passed since last update.

git.ioで短縮URLを作成する

Posted at

git.ioでは、https://git.io/fooなどのような短縮URLを作成できます。以下の様なコマンドでURLとfooの部分に来る文字列を指定します。

$ curl -i http://git.io -F "url=https://github.com/syui" -F "code=syui"

これでhttp://git.io/syuiにアクセスすると、https://github.com/syuiに飛ばされるようになります。

参考

$ curl -i http://git.io -F "url=https://github.com/..."
HTTP/1.1 201 Created
Location: http://git.io/abc123

$ curl -i http://git.io/abc123
HTTP/1.1 302 Found
Location: https://github.com/...

$ curl -i http://git.io -F "url=https://github.com/technoweenie" \
    -F "code=t"
HTTP/1.1 201 Created
Location: http://git.io/t
8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8