Created
March 21, 2014 21:54
-
-
Save JonTheNiceGuy/9697299 to your computer and use it in GitHub Desktop.
This script is deployed on jon.sprig.gs/redirect.php and those are linked to from /var/www/t -> /var/www/redirect.php etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
switch($_SERVER['REQUEST_URI']) { | |
case '/t/': | |
case '/@/': | |
case '/twitter/': | |
redirect("https://twitter.com/JonTheNiceGuy"); | |
break; | |
case '/fb/': | |
case '/facebook/': | |
redirect("https://www.facebook.com/JonTheNiceGuy"); | |
break; | |
case '/+/': | |
case '/g+/': | |
redirect("https://plus.google.com/101307558846949684774"); | |
break; | |
case '/d/': | |
case '/d*/': | |
redirect("https://joindiaspora.com/people/7f1771766a74695d"); | |
} | |
function redirect($url) { | |
if (isset($_GET['test'])) { | |
echo "Redirecting to $url"; | |
} else { | |
header("Location: $url"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment