How to redirect /%postname%.html to /%year%/%postname% ?.
How to redirect /%postname%.html to /%year%/%postname% ?.
Redirecting the post name is easy. The year... not so much. You have to know what the year is... Example: in your .htaccess:
RedirectMatch 301 (.*)\.html$ http://www.example.com/2010/$1/
See how I had to hard code 2010? If that's not something 'gettable' from the URL, it can't be parsed :/
ipstenu ...
I quite understand if it is assumed, we started writing in 2010, then we changed the permalink structure in the same year (2010).
In the cases I mean, we started writing in 2008 and changed the permalink structure in 2010. And than we need to redirect all posts with htaccess.
Is it still possible to use these RedirectPermanent? as i knew that redirection syntax is
RedirectPermanent URL_path new_absolute_URL
This topic has been closed to new replies.