Wordpress Archive Permalinks Problem

Good evening folks,
I haven’t posted up in a while, as I’ve been busy coding the backend of the blog and making it look nice on the eyes. This being a photography blog I wouldn’t usually post this up (as it’s more web design/web dev inclined) but I’ve spend the last two days trying to fix a problem and nothing online has been of help.

 

The Plan

I wanted to have nice permalinks on my blog. The plan was to have them like this – blog.kyletunneyphotography.com/day/month/year/name-of-the-post/. So the last post I had up would have looked like this – http://blog.kyletunneyphotography.com/03/02/2009/first-dublin-strobist-meet/. To do this I used the code /%day%/%monthnum%/%year%/%postname%/ within my wordpress admin control panel (Settings >> Permalinks >> Custom).

 

The Problem

All links worked perfectly EXCEPT the archive links. So what worked?
blog.kyletunneyphotography.com/
blog.kyletunneyphotography.com/day/month/year/name-of-the-post/
blog.kyletunneyphotography.com/category/name-of-category/

What didn’t work where the archive links, like March 2008 or January 2009. They would purely bring up an error #404.

You could change your permalinks to /archives/%year%/%monthnum%/%day%/%postname%/ and everything would work find. Personally, I felt that the links were starting to get too long. After lots of searching and testing a bunch of easy and difficult solutions I decided to give in and change my Permalinks. I am now only using /%postname%/

 

Search Engines?

What about the big G and everybody linking back to your old links that you previously had in place? Simple, just add the following line

RedirectMatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ http://www.domain.com/$4

to your .htaccess file in your wordpress directory and it will redirect all your traffic for you. So if somebody clicks a link or types in http://blog.kyletunneyphotography.com/30/01/2009/inspirational-photography-tips/ they will be automatically redirected to http://blog.kyletunneyphotography.com/inspirational-photography-tips/.

Nobody gets lost, no broken links and the big G doesn’t spank you!!

I hope that helps somebody from spending two days searching online for a fix.
Let me know if it helps,
Kyle

Follow me on Twitter - @kjtphotography

Twitter this article

Share

 

  1. Thanks a lot, man. I was completely lost and surfing the Wordpress forums, to no avail. Your post cleared that up. You’re right, I went the same way you did, changing the permalinks to d/m/y/post-name and my archive and calendar went haywire.
    Notwithstanding, if you change the permalinks to y/post-name, everything works fine.
    I guess they need to fix that bug. Thanks for sorting that out and saving me hours of search…

     

  2. Glad to help buddy!

     

 

Leave a comment