View Single Post

  #4 (permalink)  
Old 12-14-2006
Aray
 
Posts: n/a
Default Re: Wildcard subdmoains

I am trying to use module_rewrite to solve your problem, but not success
yet. I am newbie to apache too.

Maybe following will give you some hints

#try to response http://AAA.example.com/test.htm with /AAA/test.htm
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.example\.com$
RewriteRule ^/(.*)$ /$1/$2

--

"Rik" <luiheidsgoeroe@hotmail.com> дÈëÏûÏ¢
news:de46$4580ebcd$8259c69c$9438@news2.tudelft.nl. ..
> Hi all,
>
> just an sanity check from my part: AFAIK it should be possible in apache
> to
> set a subdomain as wildcard domain. So, in a virtualhost:
>
> ServerAlias the_target.example.com *.example.com
>
> And as long as an A record is set:
> *.example.com A 1.2.3.4
>
> Every <random_string>.example.com should arriev at the virualhost that is
> configured, am I right? So I could define a subdomain in this particular
> vhost, and it;s not required to be the 'main' domain?