301 Redirecting URLs based on GET variables in .htaccess
- by technicalbloke
I have a few messy old URLs like...
http://www.example.com/bunch.of/unneeded/crap?opendocument&part=1
http://www.example.com/bunch.of/unneeded/crap?opendocument&part=2
...that I want to redirect to the newer, cleaner form...
http://www.example.com/page.php/welcome
http://www.example.com/page.php/prices
I understand I can redirect one page to another with a simple redirect i.e.
Redirect 301 /bunch.of/unneeded/crap http://www.example.com/page.php
But the source page doesn't change, only it's GET vars. I can't figure out how to base the redirect on the value of these GET variables. Can anybody help pls!? I'm fairly handy with the old regexes so I can have a pop at using mod-rewrite if I have to but I'm not clear on the syntax for rewriting GET vars and I'd prefer to avoid the performance hit and use the cleaner Redirect directive. Is there a way? and if not can anyone clue me in as to the right mod-rewrite syntax pls?
Cheers,
Roger.