CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Creating subdomains



Feb 11, 2000, 5:44 PM

Post #1 of 3 (5045 views)
Creating subdomains Can't Post

Hello! Thanks for the database
help, I think I'll stick to
flat-file though. Anyway, my new
topic is over subdomains. My server
is a UNIX machine, and I am trying
to make a new subdomain on my domain,
how it works is that a sub directory
on the main directory (/path/to/main/subdir/)
reads as the same as a subdomain
so if I make a directory using perl, eq
mkdir(subdir, 0755); will make a directory
but how do I get to read as a subdomain?
I know I need to submit some dns things or something too, but can I do with perl as well? Also I know that "Wild Cards" is not enabled but I may be able to, but does it have to be? Thanks!

Red Dragon

Feb 11, 2000, 8:24 PM

Post #2 of 3 (5045 views)
Re: Creating subdomains [In reply to] Can't Post

The easiest way to do this on an automated basis is to redirect subdomains like to
I believe this is what you are looking for.
Use an index.cgi in your main directory that test the enviromental value of HTTP_HOST for and write to the location bar (or whatever the main file for the actual site is) if its not www then have it pull the prefix from the variable and print to the location bar.

something like this
if($ENV{'HTTP_HOST'} eq "")
print "Location:\n\n";
print "Location:$pre\n\n";

[This message has been edited by Red Dragon (edited 02-11-2000).]

Red Dragon

Feb 11, 2000, 8:31 PM

Post #3 of 3 (5045 views)
Re: Creating subdomains [In reply to] Can't Post

Almost forgot.

You will need to add a wildcard in your name server.

if its a bind name server then
should do the trick


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives