Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将子域网络邮件重定向到该域的 /roundcube。这必须适用于 apache 中的所有虚拟主机。
例子:
webmail.example.com 必须指向 [www.]example.com/roundcube
这怎么可能?必须使用直接管理员配置的服务器:S
mod_rewrite是你的朋友。
mod_rewrite
VirtualHost在您的 Apache配置中尝试这样的操作:
VirtualHost
RewriteEngine on RewriteCond %{HTTP_HOST} ^webmail\.[^.]+\.[^.]+$ RewriteRule ^webmail\.([^.]+)\.([^.]+)$ http://www.$1.$2/roundcube [R=permanent]
...并将 DNS 配置为指向webmail.example.com与www.example.com.
webmail.example.com
www.example.com