This is the original I need to modify:
https://example.com/actualites-cyclisme/criterium-du-dauphine/5115-dauphine-libere-le-parcours-devoile-lalpe-dhuez-fait-son-retour
These are the things I have done (which is what I wanted!)
https://example.com/dauphine-libere-le-parcours-devoile-lalpe-dhuez-fait-son-retour/
But... I want to include a condition, for example I do not want theses URLs to be touched:
https://example.com/123456-dauphine-libere-le-parcours-devoile-lalpe-dhuez-fait-son-retour/
https://example.com/aaaaaa-123456-dauphine-libere-le-parcours-devoile-lalpe-dhuez-fait-son-retour/
Here's my Awesome regex :
RewriteRule /?(.*)([0-9]+)-(.*)$ /$3 [R=301,L]
I probably have to say that I NEED /(.*)/0000-post
, but if I add a slash within the regex it does not work anymore.
I used http://htaccess.mwl.be btw.
?
) then that rule should still match the first URL. And it should avoid the last two URLs from matching. If not then maybe something else is going on - please post your entire.htaccess
file. Where is the trailing slash coming from? That's not part of your directive. (There's no need to have parenthesised sub groups in the regex when the backreferences are not needed.) – MrWhite Jul 22 '17 at 22:21