开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜