0
我想对所有http://blog.example.com
请求重定向到http://www.example.com/blog
mod_rewrite的子域目录
除了为example.com
所有的请求也被现在要www.example.com/blog
我有以下工作。尽管如example.com/about
等请求已正确重定向到www.example.com/about
。
我需要做些什么来保持example.com
不被重定向到example.com/blog
?
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(blog\.)?example\.com$
RewriteRule ^(.*)$ http://www.example.com/blog/$1 [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
非常感谢! – Jeff 2015-02-07 02:56:42
不客气,很高兴它解决了。 – Croises 2015-02-07 12:20:36