Forum Moderators: phranque

Message Too Old, No Replies

using wildcard

automatic sub domain

         

experienced

2:23 pm on Jul 17, 2008 (gmt 0)

10+ Year Member



we are creating automatic sub domain through admin but when a domain is created it is pointing to the same parent site everytime.

subdomain.example.com/ - pointing to the main domain content like http://www.example.com

subdomain.example.com/subdomain.html - pointing to the subdomain content page.

is there anyway to point the subdomain on the subdomain content only.

wud appreciate any help.

jdMorgan

2:34 pm on Jul 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The answer depends on your admin "control panel" options. You may be able to set an option in the control panel itself to assign each new domain to a separate subdirectory. Be aware that this complicates such things as sharing scripts among the hosted domains, but is actually the most common implementation -- Your case is relatively rare.

You can also use Apache mod_rewrite to check the %{HTTP_HOST} variable, and rewrite requests to different subdirectories based on the requested hostname. See the Apache mod_rewrite documentation, and especially the "Mass Virtual Hosting" section in the URL Rewriting Guide [httpd.apache.org].

We also have tons of previous threads here on rewriting domains or subdomains to subdirectories -- Try a search on WebmasterWorld.

Jim