Reputation: 303
I am trying to redirect multiple URLs of the same format to a different format of URLs with one statement.
Original Format: http://example.com/blog/YYYY/MM/example-title/
where YYYY is a number from 2013 - 2017 and MM is a single OR double digit number between 1-12 OR 01-12 and example title can be any length, any letters, with dashes for spaces.
New Format: http://example.com/blog/example-title.php
Please help, thank you!
Upvotes: 1
Views: 35
Reputation: 785376
Have this rule inside your /blog/.htaccess
(create it if it doesn't exist):
RewriteEngine On
RewriteBase /blog/
RewriteRule ^\d+/\d+/([^/]+)/?$ $1.php [L,NE,R=301]
# other rules go here
Upvotes: 2