Redirect subdomain to /folder
I want to redirect the sub-domain webmail to /roundcube for that domain. This have to work for all virtual hosts in apach开发者_开发知识库e.
Example:
webmail.example.com must point to [www.]example.com/roundcube
How is this possible? The server where it has to be done is configured with direct admin :S
mod_rewrite
is your friend.
Try something like this in your Apache VirtualHost
configuration:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail\.[^.]+\.[^.]+$
RewriteRule ^webmail\.([^.]+)\.([^.]+)$ http://www.$1.$2/roundcube [R=permanent]
...and configure DNS to point webmail.example.com
to the same server as www.example.com
.
精彩评论