Forum Moderators: phranque

Message Too Old, No Replies

Rewrite URL

         

marciano

12:35 am on Feb 5, 2004 (gmt 0)

10+ Year Member



Hi.
I've made some changes in my site and need to redirect
mydomain.com/anyfile?class3=PDE
to
mydomain.com/thisfile?class2=PDE
I've tried several changes of these ones but they doesn't work.
RewriteRule ^(.*)class3=PDE$ thisfile.php?class2=PDE [L]
or
RewriteRule ^file3\.php\?class3=PDE$ thisfile.php?class2=PDE [L]
Thanks in advance for any help

jdMorgan

1:20 am on Feb 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



marciano,

Welcome to WebmasterWorld [webmasterworld.com]!

The problem is that RewriteRule cannot "see" a query string; You must use RewriteCond to test it:


RewriteCond %{QUERY_STRING} ^class3=PDE
RewriteRule .* /thisfile.php?class2=PDE [L]

Ref: Apache mod_rewrite [httpd.apache.org]

Jim

marciano

2:03 pm on Feb 5, 2004 (gmt 0)

10+ Year Member



Thanks Jim for your answer.
I lost one hour looking why it doesn't work.
I discovered that it works browsing in IE6 WinXP but it does not in IE5.2 MAC OS10.2
I have another simple rules (static->dynamic) that work in Mac OS.
Do you have any idea about this?

marciano

2:31 pm on Feb 5, 2004 (gmt 0)

10+ Year Member



Sorry. Many tasks I do I use lowercase but in this case not. I've changed to uppercase PDE and worked fine.