[resolved] Moving away from date permalinks (3 posts)

  1. lonewolfonline
    Posted 8 years ago #

    I am trying to move away from having dates in my permalinks since they serve no purpose on my site. I am having trouble with a RewriteRule to redirect old permalinks.

    I would like http://www.mydomain.com/2008/07/19/my-post-title/ to redirect to http://www.mydomain.com/my-post-title/

    The rule I have been trying is
    RewriteRule ^([0-9]{4})/([0-9]+)/([0-9]+)/([^/]+)/*$ http://www.mydomain.com/$4/ [L,R=301]

    But that ends up as a 500 Server Error because the redirect never completes (loops).

    I can change the redirect from $4 to $1 and the post is redirected to /2008/, same for $2 and $3. $4 always time-out.

    Any ideas?


  2. lonewolfonline
    Posted 8 years ago #

    Don't worry, just got it sorted.

  3. microkid
    Posted 8 years ago #

    I have written a plugin that solves this with a 301 redirect, might be a little easier.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.