WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. lonewolfonline
    Member
    Posted 6 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?

    Thanks

  2. lonewolfonline
    Member
    Posted 6 years ago #

    Don't worry, just got it sorted.

  3. microkid
    Member
    Posted 6 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

Tags

No tags yet.