我想redirect下面的url
oldsite.com/index.htm?Page?somepath%2fsomefile
至
newsite.com/productindex.htm?p=somepath%2fsomefile
我有以下规则
RewriteCond %{QUERY_STRING} ^Page=(.*)$ RewriteRule ^index.htm$ http://newsite.com?p=%1 [R=301,NC,L]
但它redirect到
newsite.com/productindex.htm?p=somepath%252Fsomefile >--------------------------------------^^^^^
有很多关于一个长期存在的双转义错误的引用,最近已经修复了( 2.2.12我认为 ),并且正在运行2.2.9我认为RewriteRule B标志可能会有所帮助,但这会使情况变得更糟…
newsite.com/productindex.htm?p=somepath%25252Fsomefile >--------------------------------------^^^^^^^
来自Apache大师的任何想法?
它是我需要的NE(No Escape)标志
RewriteCond %{QUERY_STRING} ^Page=(.*)$ RewriteRule ^index.htm$ http://newsite.com?p=%1 [R=301,NC,L,NE]