Forum Moderators: phranque
As example, I'm trying to install a 301 redirect from:
www.example.com/old-page.htm?sz=m
to:
www.example.com/new-page.htm?sz=m
It looks right in .htaccess but in the browser it becomes:
www.example.com/new-page.htm%3fsz=m
and returns a 404 error.
William.
RewriteCond %{QUERY_STRING} ^[i]pattern[/i]$
Jim
Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^/some-old-file.htm$ http://www.example.com/new-file.htm?sizePref=2 [R=301,L,NE]
returns a 404 error AND is keeping my FrontPage Extensions from working!
William.
Options +Indexes +FollowSymlinks Jim
The Apache manual says this about the [NE] flag:
'noescapeŚNE' (no URI escaping of output)
This flag keeps mod_rewrite from applying the usual URI escaping rules to the result of a rewrite. Ordinarily, special characters (such as '%', '$', ';', and so on) will be escaped into their hexcode equivalents ('%25', '%24', and '%3B', respectively); this flag prevents this from being done. This allows percent symbols to appear in the output.
Which sounded exactly like my problem but it turns out I was very close, I just needed to remove the preceeding '/'.
What I ended up with was:
Options +Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^old-url.htm$ http://www.example.com/new-url.htm?sizePref=2 [R=301,L]
As always, thanks for the help!
William.
[edited by: jdMorgan at 2:54 am (utc) on Oct. 5, 2006]
[edit reason] Example.com [/edit]