WordPress.org

Ready to get started?Download WordPress

Forums

Changing URI while maintaining old one functional (4 posts)

  1. davidcollantes
    Member
    Posted 7 years ago #

    I have been using since the beginning (coming from my very first MT installation) the URI (for archives, single pages) as:

    /archives/year/month/day/title-of-entry/

    I would like to drop the /archives part while keeping the old way viable still, so indexed entries and links/trackbacks do not break.

    Does anyone knows how to accomplish this? Any help appreciated.

    Cheers.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    You'll need to add a rewrite rule into your .htaccess to redirect the old way to the new way. Something like this should work:

    (this should be all one line)
    RewriteRule /archives/(.*) http://yoursite.com/$1 [R=301,L]

    Then just change your permalink configuration to the new way.

  3. davidcollantes
    Member
    Posted 7 years ago #

    Excellent, that works just fine. I also found out (after I did it just like you proposed) that there is a plugin that does it as well. It is:

    http://www.deanlee.cn/wordpress/permalinks-migration-plugin/

    Thank you much, Otto!

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    The migration plugin is much more flexible, and I recommend it if you are doing anything more complex than the above, however for simple changes like this one, the RewriteRule is a) faster and b) causes less load on your site. So use those when you can, but if you can't, that plugin is a good choice.

Topic Closed

This topic has been closed to new replies.

About this Topic