Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Redirect http://example.org/@ to a specified Twitter profile.

  • Loading branch information...
commit 8cc855ddbb898f439722d271d8671d14302d84fb 1 parent e3d8c82
Mathias Bynens authored

Showing 2 changed files with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 0  README.md
  2. +3 1 index.php
1  README.md
Source Rendered
@@ -9,6 +9,7 @@
9 9 ## Features
10 10
11 11 * Redirect to Twitter when given a numerical slug, e.g. `http://mths.be/8065633451249664` → `http://twitter.com/mathias/status/8065633451249664`.
  12 +* Redirect to your Twitter account when `@` is used as a slug, e.g. `http://mths.be/@` → `http://twitter.com/mathias`.
12 13 * Redirect to your Google Plus account when `+` is used as a slug, e.g. `http://mths.be/+` → `https://plus.google.com/u/0/116553353277057965424/posts`.
13 14 * Redirect to your main website when no slug is entered, e.g. `http://mths.be/` → `http://mathiasbynens.be/`.
14 15 * Redirect to a specific page on your main website when an unknown slug (not in the database) is used, e.g. `http://mths.be/demo/jquery-size` → `http://mathiasbynens.be/demo/jquery-size`.
4 index.php
@@ -8,7 +8,9 @@
8 8
9 9 $slug = $_GET['slug'];
10 10
11   - if (' ' == $slug) { // +
  11 + if ('@' == $slug) {
  12 + $url = 'http://twitter.com/' . TWITTER_USERNAME;
  13 + } else if (' ' == $slug) { // +
12 14 $url = 'https://plus.google.com/u/0/' . GOOGLE_PLUS_ID . '/posts';
13 15 } else {
14 16

0 comments on commit 8cc855d

Please sign in to comment.
Something went wrong with that request. Please try again.