Remove query strings from 301 redirect

非 Y 不嫁゛ 提交于 2019-11-30 09:07:40
kaptinkaos

two options:

redirectMatch 301 ^/about/ http://www.newsite.com/info? 

or:

RewriteEngine on
RewriteRule ^about/(.*) http://www.newsite.com/info? [L,R=301]

question mark at the end seems to be the critical bit. Second one looks a little cleaner (first leaves a question mark at the end of your URL)

Try to add this code into the .htaccess that specified for oldsite.com:

RewriteCond %{REQUEST_URI} ^/about/index.cfm$
RewriteRule ^(.+) http://www.newsite.com/info/ [R=301,QSA]

Follow up?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!