URL Subdomain Redirection – how and why?

UPDATE: I eventually abandoned the site. Interest wasn’t terribly high (turns out there are numerous other options out there), and it didn’t really take off the way I’d originally hoped. Write-up is still here for anyone interested, but keep in mind the actual site is gone.


Last night, I decided to start up another website. This one was going to use a subdomain redirection script. I registered xyURL.com, found a script, and finally today finished setting it up on the site. “What’s a subdomain redirection script?” you might ask. Quite simply, it’s a script that automatically generates subdomains on a website and allows those subdomains to point at various URLs. These scripts in particular allow a user to register a subdomain, and then point that subdomain to one of their web pages or web sites. In my case, someone can register http://username.xyurl.com and have it point to their own website.

The first question that might come to mind is… why would somebody want a subdomain like that…? …and who? Well a few people might. For example, someone who has web pages uploaded with thier ISP might have an unfriendly URL.

Say for instance Ken Jefferson has the following URL:
Now Ken Jefferson might have some good stuff on his website. The problem is, when he tells people about his site over the phone, they never quite get the URL right. They always forget the ~ or being the non-tech-savy users they are, they type “” instead of “/”. Ken Jefferson can instead get the following:

How about another example… Sally has the following MSN space set up:

Sally really didn’t want to be the 13th coolgirl, the problem was that so many people wanted the name coolgirl that she didn’t really have much choice. Now she can get:

And a final example… Frank has his resume online, available for download. He has applied for a few jobs, but has noticed that some of his peers applying for interviews have their own domain. Frank doesn’t have his own domain, and feels that his peers look more professional than he does with his resume available only from his geocities account. In fact, since most of the potential employers receive so many applications, he’s sure that some don’t even bother to download his resume from:
Lucky for frank, he can now register a subdomain at:

Now obviously these situations might be a little exaggerated, but you can see where there is a market for this, especially if it’s free. Not only do popular usernames disappear quickly with the larger free web hosts, but they also usually give the user a directory instead of a subdomain. Many users wouldn’t mind being able to pick their own subdomain name, having it attached to a relatively short domain. That’s how www.xyURL.com came about.

For those who’ve come across this article looking to register your own subdomain, look no further. Head over to xyURL.com and sign up. It’s free.

For those of you looking for more information on how to offer your own URL subdomain redirection on your website, keep reading.

Starting your own URL redirection website

First, you have to make sure your web host will support this type of script. These scripts require what is called a “wildcarded subdomain” also known as a “wildcarded DNS” set up on the main domain. Those with shared hosting will want to ask their hosts before going any further. It’s apparantly quite easy to set up, and most hosts shouldn’t have a problem doing it.

Next, you will need some verson of PHP and MySQL. Each script has it’s own requirements as to what the minimum version is.

Now, you have to get a script. During my searches, I was only able to find a few, and most were pretty outdated. From what looked best to what looked to be the worst, here’s what I came up with:
www.scripts24.com/iredirector/subdomain/index.php iRedirector(now a parked domain) – $59.99
milliscripts redirection – FREE
solutionscripts.com/warehouse/redirect/index.html Redirect It (site no longer works) – FREE

You can get more information on their websites, but I’ll give you a little info about each.

iRedirector – comes in 2 editions, a directory and a subdomain script. You of course are looking for the subdomain one. The price is $59.99 if you keep the link back to their site, and $129.99 if you want to remove the link. They have a demo which is about 80% functional and gives you an idea of what things look like. It’s the ‘cleanest’ of the interfaces, but it’s still not pretty. I would guess it is probably the easiest to set up. There is a forum on the website if you have any questions.

milliscripts redirection – seems to be a few years old, but it still works. The price is free, although the author asks that you leave the link back to his site. I will go into a little more detail about the setup and install process, but in short, plan to spend at least a few hours getting things looking ok. Somewhat ugly interface, and yes it looks a few years old.

Redirect It – looks to be completely CGI based, and uses Perl. I don’t believe it requires a MySQL database, it appears to create it’s own in a folder. Every link on their website is broken except for the download link, so you can still download the program, although you will probably be dependant on the readme.txt file within. Here is a blurb taken from the website:

Redirect It, it a new program from Solution Scripts that will allow you to run a redirection service from your web site. Give out shorter urls like (username.domain.com) or (domain.com/username). Running a redirection service off your domain can help with name branding, and increase ad revenue by showing ads to the people being redirected.

Redirect It is a small easy to set up program but is packed with features. Redirect It can be configured multiple ways to fit the way you want your service run. For example you can used sub domains and have user have urls like (username.domain.com) or run it using folder based redirection with a url like (domain.com/username).

You can also configure how the user is redirected and what is shown. One method uses a splash screen, where the user is shown any html you like for a few seconds before being redirected to the real web site. The other method uses a frame and a popup window. The pop-up window can be configured to any url you like, and the frame contains the web site.

Using milliscripts redirection

I didn’t really feel like spending $60 for iRedirector when there was one available for free. If iRedirector had a beautiful interface, than I might have, but it looked very similar to milliscripts. Redirect It on the other hand, while free, looked to be extremely old (1999 as the copyright date in the readme). Therefore, I went with milliscripts.

First, I registered the domain name, and contacted my web host about the subdomain wildcard. Once they had it set up, I started following the steps in the readme.txt file. Hopefully, most of you won’t have much trouble with it. All your really have to do is:

  1. Set up a MySQL database
  2. Copy all the files over, making sure you keep the “myred” folder intact.
  3. Edit one of the php files and update it with your database info.
  4. Run the setup.php file.
  5. Delete setup.php and upgrade.php.
  6. Run admin.php to set up at least 1 domain and 1 category.
  7. Done

Now one problem you might have is the home page. It asks you for the name of an index page or a home page. This is fine if you have one and are simply planning to add a link to register.php on your home page. Unfortunately if you don’t have a home page, you’re in a bit of a pickle. Here’s what you do. You’re basically going to copy one of the more “blank” php and html files. You’re going to choose the FAQ page which is completely empty:

  1. When it asks for the home page during setup, use /myred/home.php.
  2. In the myred directory, copy the faq.php file to home.php
  3. In the templates directory, copy faq.html to home.html
  4. Edit home.php and change the references from faq.html to home.html. Otherwise, home.php will load the faq template page.
  5. Edit home.html and make any changes there you want.

There is another more painful option, and it’s the one I chose. Instead of keeping the myred directory, I decided to put it all in the main directory. I used the .htaccess from the main directory, not the one from the myred directory. I also had to edit the index.php file and make changes so that it wouldn’t point to the myred directory. A problem I came up with was that when the confirmation emails were sent out to verify an account, the path to confirm the account included the myred folder. To fix this, I had to edit the english.php file in the language directory and find the line for “text59” which needed the path changed. Note that you could probably use redirects so that any requests for the myred directory will simply point to the main path, and it might save you a lot of time. OR, you could just do what you’re supposed to do and leave the myred directory intact ;)

Final things I would recommend you do:

  • Edit all the .html files in the templates directory. Replace “your text here” and customize each page
  • Pull the CSS out of the .html files and create a single .css file
  • Edit the english.php file in the language directory. You often have to edit entries here instead of in the .html files
  • Do a trial run, setting up a subdomain.

All in all, for being a free script, milliscripts redirection isn’t really that bad. Yes, you will probably have to spend hours to make it look great, but it’s fairly functional ‘out of the box’.

If anyone knows of other redirection scripts, or has had experiences with any of the ones I’ve mentioned, I’d be interested in hearing about it :)

In the meantime, feel free to check out www.xyURL.com.

UPDATE: Site no longer exists.