> You could do that using mod_rewrite, the prolem is that if the
> subdomain doesn't exist you'll get a 404 error.
If the sundomain does not exist you will get "host not found" or
"lookup failed" error in idea, because 404 is HTTP status code
and apache has nothing (well, almost) to do with such domains.
This can be easily solved by adding wildcard entry to BIND (or any
other dns server that supports thats -- up to you) zone file, e.g.
; SOAs etc. here
myhost.com IN A 12.34.56.78
*.myhost.com IN A 12.34.56.78
And using mod_rewrite like this: [in global config file, e.g.
/etc/apache/httpd.conf]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*).myhost.com$
RewriteRule ^(.*)$ <a style='text-decoration: underline;' href="http://myhost.com/%1$1" target="_blank">http://myhost.com/%1$1</a> [R]
(Sorry if I have mistyped something
This is much, much, much better than using <VirtualHost *> unless you
are frightened by mod_rewrite (voodoo?)<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: Folders and subdomains