Subdomain Forwarder

software development


Is is possible to program a PHP script to make a subdomain forwarder ?

I.E. True Domain =
and if I go to it’s forwarded to


Probably, but why would you want to do that? only returns a “not found” page at google. Did you mean to have it redirect to



Something like that, I’m not really going to be using those domains though, they were just for the example to explain of what I’m looking for.


It seems to me that it should be doable, but your first (and probably biggest) problem is having DNS resolve for the subdomains.

Unless those domains actually exist in the nameservers records, anyone browsing to them would just receive a “not found”.

I suppose if you got DH to turn on Wildcard subomains for you (see the wiki) then you could write a script that takes the url and parses it to extract the subdomain into a variable, and then append it to the url and go there.

That said, I can’t see much point in doing that, as you can more easily embed a google search into your site using google code. :wink:



Ahh Wildcard Domains.
Thanks, looks like I won’t be able to do what I was looking at doing.

Ah well it was just something for fun on a small site anyways :slight_smile: