Question

I migrated from a Windows server to a Linux one and I am very new to htaccess. Also, I changed my permalinks structure from /year/month/post to /post . To make sure the old search engine links still worked I added the following line to the htaccess file which is working fine to redirect the old URLs to the new ones, but read on:

RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.*)$ http://www. keptlight .com/$3

Now, my year/month archives always point to the site root since /year/month/ are being stripped. For instance:

www. keptlight .com/2014/02/ orchis-is-coming-2/

is properly redirected to:

www. keptlight .com/orchis-is-coming-2/

But the monthly posts for a given month:

www. keptlight .com/2011/06/ or any other year/month is always redirected to:

www.keptlight.com

Is there a way to overcome this problem and properly display the monthly archives when only year/month/ follows the domain with no post title?

Thank you in advance.

Cemal Ekin

Was it helpful?

Solution

Try

RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})(/.+)+$ http://www.keptlight.com$3
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top