Hello,
I have a PERL script running I coded years ago where I used a blank in an URL which resulted in a bunch of permutated URLs over the years, e.g.
/cgi-bin/page.pl?page=product_overview
/cgi-bin/page.pl?page=product overview
/cgi-bin/page.pl?page=product%20overview
/cgi-bin/page.pl?page=product%2520overview
After a site relaunch the same content is now delivered by:
/products.php?page=overview
and should be reached user friendly:
/products
So I have to do 2 consecutive rewrites. Reading around in this forum and other boards I ended up with this solution:
RewriteCond %{QUERY_STRING} ^page=product(.+)$ [NC]
RewriteRule ^cgi-bin/page\.pl$ /products [R=301,L]
RewriteRule ^products$ /products.php?page=overview [L]
This seems to work. I'm just starting to enter the world of mod_rewrite. I'm aware of the dangers of improper usage of the module so any comments would be greatly appreciated.
Thanks