Forum Moderators: phranque

Message Too Old, No Replies

/? is being ignored in my rewrite rule.

         

moroandrea

4:35 pm on Nov 22, 2010 (gmt 0)

10+ Year Member



Hi All,

I don't know why, but I've a problem with a number of rules that are getting me crazy.

It looks like escaping the charater ? is ignored, therefore I don't get my rules matched.
Do you know why?

This is what I have in my httpd.conf file. I reduced to a very few lines to understand where the error is, but without results.

Any help is really appreciated.

RewriteLog "/etc/apache2/RewriteLog.log"
RewriteLogLevel 3

RewriteEngine On

#*****************
#**** US URLs ****
#*****************
#\/\/\/\/\/\/\/\/\/

RewriteRule ^/product\/index\.jsp\?(.*)2119855$ [us.test.com...] [R=301,L,NC]

moroandrea

9:20 am on Nov 23, 2010 (gmt 0)

10+ Year Member



Well I solved adding a RewriteCond and cheching the pattern into the condition rather than into the rewriterule itself.

I'm not sure if this is the most efficient way, but at least it worked.

milosevic

11:43 am on Nov 23, 2010 (gmt 0)

10+ Year Member



moroandrea, this didn't work because Querystrings aren't part of the URL that RewriteRule sees.

As you discovered, you have to use a rewritecondition to match or backreference querystrings.