IIRF: exlude QSA parameter from lowercase on rewrite rule

219 views Asked by At

in my config I have:

Add trailing slash to url and Lowercase

RewriteRule ^/([^.?]+[^.?/])$ /#L$1#E/ [I,R=301]

URL LowerCase

RewriteRule ^/(.*[A-Z].*)$ /#L$1#E [R=301]

rule

RewriteRule ^/category/([^\?\/]+)/((\?.+)|())$ /cat.asp?menu=3&set=$1 [QSA,I,U,L] 

now, if I have:

/Category/Test/?gclid=AhdHHSdhjfo34 

this is rewrite to:

/category/test/?gclid=ahdhhsdhjfo34 

I want QSA parameters is not lowercase:

/category/test/?gclid=AhdHHSdhjfo34 

How to do it?

1

There are 1 answers

0
Brizio On

i have found this solution:

replace

  RewriteRule ^/(.*[A-Z].*)$ /#L$1#E [R=301]

with

  RewriteRule ^/(.*[A-Z].*)\?(.*)$ /#L$1#E [QSA,R=301]