httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rich Bowen <rbo...@rcbowen.com>
Subject Re: rewrite rule user dir as subdomain
Date Thu, 05 Nov 2009 15:35:19 GMT
There is actually already that example in the rewrite guide. Like many  
of the other examples, it is well concealed, and doesn't work very  
well. Using mod_rewrite for this causes a number of things to break on  
an alarmingly regular basis - most significantly, dynamic thingies  
tend to get served as static files all too often.

One of the new main focuses of the rewrite guide is to nudge people  
towards solutions that don't use mod_rewrite, such as, in this case,  
mod_vhost_alias.

The sheer number of people who are doing virtualhosting at  
the .htaccess file level is pretty alarming.



On Nov 5, 2009, at 01:58 , Mario Brandt wrote:

> Hi!
> I've often been asked how to make userdir as a sudomain.
>
> Maybe that can be as well in the rewrite guide.
>
>
> cheers
> Mario
>
>
>
> DocumentRoot /webhosts/
>
> [...]
>
> <VirtualHost *>
> ServerAlias www.example.com
> ServerName www.example.com
> RewriteEngine  on
> RewriteCond    %{HTTP_HOST}  ^example.com
> RewriteRule    ^(.*)$        /www/$1 [L]
> RewriteCond    %{HTTP_HOST}  ^www.*
> RewriteRule    ^(.*)$        /www/$1 [L]
> RewriteCond    %{HTTP_HOST}  ^(.*)\.example\.com
> RewriteRule    ^(.*)$        /%1/$1 [L]
> </VirtualHost>
>
> Will be translated to
>
> www.yourdomain.com => /webhosts/www/
> muon.yourdomain.com => /webhosts/muon/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
> For additional commands, e-mail: docs-help@httpd.apache.org
>

--
Rich Bowen
rbowen@rcbowen.com




---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message