Subdomain Forwarder

software development

#1

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

I.E. True Domain = www.dreamhost.com
and if I go to pgp.dreamhost.com it’s forwarded to google.com?search=pgp
?


#2

Probably, but why would you want to do that? http://google.com?search=pgp only returns a “not found” page at google. Did you mean to have it redirect to google.com/search?q=pgp?

–rlparker


#3

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.


#4

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 google.com 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:

–rlparker


#5

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: