url query string changing after redirect

avir
avir used Ask the Experts™
on
I had this question after viewing redirect certain certain urls to a subdomain on a different server.

I have a particular problem now which, in the meantime I've found a work-around for, but I don't understand why I'm having this problem. I created a series of rewrite matching redirect rules in the htaccess file that points those urls back to our previous server, which now has a subdomain. I have a set of urls that contain query strings that contain spaces (for instance: www.imj.org.il/artcenter/newsite/en/?artist=Abu Kaf, Ali&list=A). When the url gets redirected, the space in the url gets encrypted to %2520 instead of %20 and because of that, the query string is not recognized. I'd like to know why that extra "52" is inserted into the querystring? Here is my redirect rule:
RewriteRule ^artcenter/newsite/en(.*)$ http://museum.imj.org.il/artcenter/newsite/en/$1 [R=301,NC,L]
I should also add that the redirect is to a windows server which might explain this?
Thanks for your help.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2004
Commented:
The extra is actually %25, which is '%' sign.  Use the [NE] flag on your rules to prevent this from happening.

Also, if you want the query string to follow along with the redirection, make sure you use the [QSA] flag as well.

Author

Commented:
That seems to have worked. Thanks for your help.

Author

Commented:
Thank you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial