Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Looking through Google Webmaster Tools, I have a lot of 404s for posts with permalink structure of /%year%/%month%/%day%/%postname%/

I have since changed permalinks to /%category%/%postname%.html

I thought Wordpress could redirect old post URLs to new post URLS, but the old date based URLs are generating 404s.

My .htaccess file is writable, set to 644.

Why is this occurring? Thanks!

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

WordPress doesn’t catch all old URLs, you have to help it. Add the following code to your .htaccess above the WordPress rewrite rules:

RedirectMatch permanent /\d+/\d+/\d+/(.+)$ /?pagename=$1
share|improve this answer
    
Blam! Thanks very much toscho! –  Steve Sep 7 '12 at 8:53
    
It's not working now for some reason. –  Steve Sep 15 '12 at 13:44
    
What happens instead? –  toscho Sep 15 '12 at 14:00
    
Sorry, just a 404 error. –  Steve Sep 16 '12 at 7:06
    
Does the URL change? –  toscho Sep 16 '12 at 7:52
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.