WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] .htaccess rules after changing permalinks... (2 posts)

  1. cyrillsneer
    Member
    Posted 6 years ago #

    I am about to change our permalink structure from:

    /%date%/%postname/

    to

    /static-folder-name/%postname%/

    Obviously this is going to suck for SEO so i was going to write an .htaccess rule to redirect our old posts to the new url structure.

    However I pretty thick with regards to .htaccess rules, so does anyone have idea of what rule i should write?

    Any help would be appreciated.

    Thanks

  2. cyrillsneer
    Member
    Posted 6 years ago #

    Just incase anyone else comes across this problem, here is the solution:

    # .htaccess in DocumentRoot
    RewriteEngine on
    RewriteRule ^/?\d{4}-\d{2}-\d{2}/([-a-zA-z0-9_]+)$/static-folder-name/$1/ [L]

Topic Closed

This topic has been closed to new replies.

About this Topic