I have a rewrite rule in Htaccess as below for a dynamic URL
RewriteRule ^cartoon-([^-]*)-([^-]*)\.html$ /fm
/cart_new?r_id=$1&location=$2 [L]
This rule results into URL as http://localhost/fm/cartoon-34-singapore.html
Now my client want to change this URL to http://localhost/fm/singapore/34/goofie and i wrote .htaccess as
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/?$ /fm
/cart_new?location=$1&r_id=$2&cartooname=$3 [L]
The above rewrite is working fine but client wants that all OLD URLs like i.e.http://localhost/fm/cartoon-34-singapore.html shall 301 redirect to http://localhost/fm/singapore/34/goofie.
This is driving me crazy. I have tried various things but none seems working.
http://localhost/fm/cartoon-34-singapore.htmldoesn't havecartoonamein it. So it cannot redirect tohttp://localhost/fm/singapore/34/goofie- anubhava