Hello,
Content is currently served by a PERL script, e.g.:
http://www.example.com/cgi-bin/script.pl?main_group=group2&sub1=topic
I recoded the script in PHP and in an effort for nice URLs I plan to use this rewrite rules in the .htaccess:
# Enable clean URLs like http://www.example.com/group2/topic
RewriteRule ^(group1|group2|group3)/([-a-zA-Z0-9_]+)$ /script.php?main_group=$1&sub1=$2 [L]
# REDIRECT FOR OLD PERL URLs
RewriteCond %{QUERY_STRING} ^main_group=([-a-zA-Z0-9_]+)&sub1=([-a-zA-Z0-9_]+)$ [NC]
RewriteRule ^cgi-bin/script\.pl$ http://www.example.com/%1/%2? [R=301,L]
While the first rewrite is working I'm not able to make the 301 Redirect work for the old URLs.
Forgive my newbie questions, once per year I get confronted with mod_rewrite and each time I realize I forgot what I learned the year before.
Thanks for your help.
redox