httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Brandt <jbl...@gmail.com>
Subject rewrite rule user dir as subdomain
Date Thu, 05 Nov 2009 09:58:17 GMT
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


Mime
View raw message