Forum Moderators: phranque

Message Too Old, No Replies

Prevent question mark from being URL-escaped when using RedirectMatch

Where using rewrite would be inappropriate

         

maerk

12:56 am on Mar 14, 2006 (gmt 0)

10+ Year Member



I'm trying to use RedirectMatch to do this:

example.com/posts/a-santised-post-slug/

to:

example.com/index.php?name=a-santised-post-slug

using:

RedirectMatch ^/posts/([a-z-]+)/?$ http://example.com/index.php?name=$1

But the question mark is escaped to %3f. Is there any way I can prevent it from being escaped by modifying my RedirectMatch? I know I can use rewrites here, but I don't want to for a number of reasons.

maerk

12:15 am on Mar 15, 2006 (gmt 0)

10+ Year Member



Apologies, I found an earlier post on this forum (5752.htm) which explains that question marks are always escaped, it's part of Apache and there's nothing that can be done about it.

jdMorgan

12:37 am on Mar 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, it's not a problem if you use mod_rewrite, but apparently, no-one knew how to handle it with RedirectMatch.

Jim