Previously, I have a redirect rule
RewriteRule ^([A-Za-z0-9-]+)(---[^/]+)/?$ pc.php?name=$1&id=$2 [L,NC,QSA,NE]
1) This gives an output: http://me.com/i-am-here—125/
Now, I want it to change to something better and more SEO friendly. I am using the below rewrite rule.
RewriteRule ^([0-9-]+)/([A-Za-z0-9-]+)/?$ pc.php?id=$1&name=$2 [L]
2) This gives an output: http://me.com/125/i-am-here/
My question: How do I redirect all the old URL (1) to the new URL (2) format?
2
Answers
You can try something like this:
You can have this redirect rule before your existing rewrite rule: