WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to change permalinks structure without breaking current urls (6 posts)

  1. johnl
    Member
    Posted 3 years ago #

    We are using wordpress 3.0.1 and using the following permalinks structure /%category%/%postname%/. We have lot of sub categories so the problem is url is becoming long.

    eg. http://www.example.com/flood/100year/critical/flood_property_information_1/

    Is it possible to change permalinks structure in settings without breaking current urls.

    When I change permalink structure to /%post_id%/%postname%/ I want wordpress to create new url with new permalink structure but keeping old urls same.

    If i create flood_property_information_2 post then i want both urls to work by not rewriting old url.

    http://www.example.com/flood/100year/critical/flood_property_information_1/
    http://www.example.com/2/flood_property_information_2/

    Is there a simple solution for this? Thanks for your help.

  2. Actually, all you need to do is change the permalinks. WordPress will automatically 301 (permanent) redirect traffic from the old permalinks to the new permalinks.

  3. johnl
    Member
    Posted 3 years ago #

    Thanks for the tip. It works.

  4. You're welcome!

  5. johnl
    Member
    Posted 3 years ago #

    I guess I spoke too soon. forgot to remove this url redirect in .htaccess when tested this specific url. I did more testing today. It's redirecting fine for when url has only one category. when it has sub categories in url it's returning 404 status code.

    eg. http://www.example.com/flood/flood_property_information_1/ gets redirected to http://www.example.com/flood_property_information/1

    eg. http://www.example.com/flood/100year/critical/flood_property_information_1/ returns 404 instead redirecting since it has two subcategories under flood.

    Is there a way to fix url redirection issue with sub categories? If there is no fix can you please tell me how to generate urls for all posts in wordpress so i can manually put redirects in .htaccess for all those urls?

    Thanks for your help.

  6. johnl
    Member
    Posted 3 years ago #

    I used "Permalinks Moved Permanently" plugin that fixed the issue with redirecting to correct url it has more than 1 category in url. I thought wordpress 3.0.1 version will automatically handles this but i guess it's not.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.