二级目录下的页面,子目录下也存在htaccess文件,配置有自己的规则,根目录的301跳转规则对子目录无效,需要在子目录下重作301重定向。(301重定向)子目录与根目录的不同之处:访问地址后面有没有加斜杠所请求的地址会有不同,规则如下:
rewritebase /newsrewritecond %{http_host} ^jbxue.com [nc]rewriterule com(.*)$ http://bbs.it-home.org$1 [l,r=301]#不加斜杠请求的地址是/wwwroot/jbxue.com/news/rewritecond %{http_host} ^jbxue.com [nc]rewriterule (.*)$ http://bbs.it-home.org/news/$1 [l,r=301]rewritecond %{http_host} ^192.168.8.88 [nc]rewriterule com(.*)$ http://bbs.it-home.org$1 [l,r=301]rewritecond %{http_host} ^192.168.8.88 [nc]rewriterule (.*)$ http://bbs.it-home.org/news/$1 [l,r=301]