
rbowen at rcbowen
Nov 5, 2009, 7:35 AM
Post #3 of 3
(81 views)
Permalink
|
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[at]httpd.apache.org > For additional commands, e-mail: docs-help[at]httpd.apache.org > -- Rich Bowen rbowen[at]rcbowen.com --------------------------------------------------------------------- To unsubscribe, e-mail: docs-unsubscribe[at]httpd.apache.org For additional commands, e-mail: docs-help[at]httpd.apache.org
|