I just moved my website to a new permalink structure and need to do the following for some URLs.
I'd like to take the final "slug" after the number in
/Annuaire-Artisan-106-creation-complete-de-salle-de-bains.htm
Replace hyphens to plus signs, and redirect to /travaux/new+slug+with+plus+signs
without the final .htm.
...So
/Annuaire-Artisan-106-creation-complete-de-salle-de-bains.htm
becomes
/travaux/creation+complete+de+salle+de+bains
I currently have :
RewriteRule ^Annuaire-Artisan-([0-9]+)-(.*)-(.*).htm$ /Annuaire-Artisan-$1-$2+$3.htm [L,R,NE]
... that correctly transform the hyphens in the last part to plus signs :
/Annuaire-Artisan-106-creation+complete+de+salle+de+bains.htm
But I can't find the second RewriteRule to ignore the initial Annuaire-Artisan-106-
and final .htm
and rewrite to /travaux/creation+complete+de+salle+de+bains
Any help would be greatly appreciated :)