【发布时间】:2012-10-29 06:52:31
【问题描述】:
我在 apache 中创建 pernament (301) 重定向时遇到问题:
我有 2 个域:
olddomain.com 有许多子域
newdomain.com
我想像这样重定向:
如果用户在http://anysubdomain.olddomain.com 上输入,则应重定向到http://anysubdomain.newdomain.com
如果用户在http://olddomain.com/something 上输入,则应重定向到http://newdomain.com/something
如果用户在http://olddomain.com/different/index.html 上输入,则应重定向到http://newdomain.com/different/index.html
如果用户在http://example.olddomain.com/ex/index.html 上输入,则应重定向到http://example.newdomain.com/ex/index.html
我不知道该如何设置:
<VirtualHost *:80>
ServerName olddomain.com
</VirtualHost>
问候
【问题讨论】:
标签: apache mod-rewrite apache2 apache2.2