Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is a free/open source software available where I can create simple aliases that will redirect to different servers? For example, if I were to type: "http://go/wp" it would redirect me to server1.mydomain.com?

Sort of like tinyurl I guess. But simpler. Any recommendations?

share|improve this question
    
I'm not aware of a software solution for this, per se, but I did write an open-source URL redirector in PHP and MySQL, the code for which is freely available on Google Code. Since I don't believe in advertising on this site, and it would be frowned upon, you'll have to do some link following from my profile page to get to it. And even then, it may not be what you're looking for. –  user3463 Jan 10 '11 at 7:54

2 Answers 2

up vote 1 down vote accepted

I usually do this on my site in this way: forward example.com/go/superuser to superuser.com

  1. set up a dir on my site: such as go/super on example.com

  2. under super user, create index.php like this

<?php
// If use Permanent 301 redirection:
// header("HTTP/1.1 301 Moved Permanently");
$url = "http://superuser.com";
$default_referer = "http://fclose.com/b/";
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER["HTTP_REFERER"] : $default_referer;
// 302 redirect:
header("Referer: " . $referer);
header("Location: " . $url);
exit();
?>

This method requires you to write some code and create directory on server each time you want to add a short URL. But it is easy and fast.

share|improve this answer
    
I am using this method right now, and it is indeed quick and gets the job done. But requires manual steps too much. For now, it seems to be good enough. Thanks for posting it. –  Daze Feb 12 '11 at 4:14

Firefox natively support this: Add a keyword to a bookmark and typing that keyword will open the bookmark. OS-wide, you could presumably put 'go' in your hosts file as 127.0.0.1, set up an http server, and use the url to force the desired redirect to the browser. But as a self-contained package, I don't know of one.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.