Forum Moderators: phranque

Message Too Old, No Replies

Rewrite dynamic urls

remove unwanted query strings e.g. /?id=555

         

cheaperholidays

5:28 pm on Nov 11, 2006 (gmt 0)

10+ Year Member



Hello everyone

I have adapted this rewrite from the great Jd Morgan <bows low> to catch all the potential numbers in the string

RewriteEngine on
RewriteCond %{QUERY_STRING} &?unid=(.*)&?
RewriteRule ^$ http://www.example.com/? [R=301,L]

After we had these weird strings attached our our / page as in

http://www.example.com/?unid=333

Does anyone see a problem 301 redirecting them back to our index page as in www.example.com/ or is there a better way perhaps everything after the?

To prevent duplication issues

MANY THANKS

Pete

[edited by: jdMorgan at 5:34 pm (utc) on Nov. 11, 2006]
[edit reason] Example.com [/edit]