我正在尝试将域a的网址重定向到域b,其中重定向已完成以适合域b的最佳可能网址
例如,从域A进行301重定向。
http://www.abc.com/blog/
http://www.abc.com/old-games?view=pages&layout=sell
博客旁边有很多pgaes,在旧游戏等下还有许多页面作为子URL。
域B
http://www.xyz.com/index.php?option=com_blog&view=entry&Itemid=5
http://www.xyz.com/index.php?option=com_forms&view=pages&layout=sellgames&Itemid=10
在htaccess重定向条件下尝试过
RewriteCond %{REQUEST_URI} ^.*/blog.*$
RewriteRule .* http://www.xyz.com/index.php?option=com_blog&view=entry&Itemid=5 [R=301,L]
RewriteCond %{REQUEST_URI} ^.*/old-games.*$
RewriteRule .* http://www.xyz.com/index.php?option=com_forms&view=pages&layout=sellgames&Itemid=10 [R=301,L]
重定向正在发生
http://www.xyz.com/index.php as tested using http://htaccess.madewithlove.be/
pl建议最好的方法,好像上面的东西错过了一样
谢谢
用以下代码替换您的代码:
RewriteRule ^blog(/|$) http://www.xyz.com/index.php?option=com_blog&view=entry&Itemid=5 [R=301,L,QSA,NC]
RewriteRule ^old-games(/|$) http://www.xyz.com/index.php?option=com_forms&view=pages&layout=sellgames&Itemid=10 [R=301,L,NC,QSA]
确保在其他浏览器中进行测试或清除浏览器缓存。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句