Forum Moderators: phranque

Message Too Old, No Replies

RewriteRule on args

         

johnnypoll

2:52 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



If I have:

RewriteRule (.*)this(.*) $1that$2

then

www.mysite.com/this becomes www.mysite.com/that

but

www.mysite.com?this=3 does NOT become www.mysite.com?that=3 at least on my apache installation

How can I do substitutions on the bits of the URL after the question mark i.e. on the parameters?

Thanks
John

dcrombie

3:30 pm on Nov 26, 2004 (gmt 0)



The syntax you need is something like the following:

RewriteCond %{QUERY_STRING} "^this=(.*)" 
RewriteRule (.*)\.html$ /$1?that=%1 [R]

Good luck ;)

... and welcome to Webmasterworld [webmasterworld.com]

johnnypoll

4:17 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



Super job, thanks.