English 中文(简体)
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 apache.

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.





相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签