2

I want to redirect the following url

oldsite.com/index.htm?Page?somepath%2fsomefile 

to

newsite.com/productindex.htm?p=somepath%2fsomefile 

I have the following rules

RewriteCond %{QUERY_STRING} ^Page=(.*)$ RewriteRule ^index.htm$ http://newsite.com?p=%1 [R=301,NC,L] 

But it redirects to

newsite.com/productindex.htm?p=somepath%252Fsomefile >--------------------------------------^^^^^ 

There are a lot of references about a long standing bug with double escaping that was recently fixed (2.2.12 I think) and as I am running 2.2.9 I thought the RewriteRule B flag may help, but it makes it worse...

newsite.com/productindex.htm?p=somepath%25252Fsomefile >--------------------------------------^^^^^^^ 

Any ideas from the Apache gurus?

1 Answer 1

3

Its the NE (No Escape) flag that I need

RewriteCond %{QUERY_STRING} ^Page=(.*)$ RewriteRule ^index.htm$ http://newsite.com?p=%1 [R=301,NC,L,NE] 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.