Support » Fixing WordPress » Premalinks change

  • Hi all,

    I was hoping if someone could help me with my quest here, I have my premalink structure /%category%/%postname%/, now I need it to be /%category%/%postname%.html so my Social reader app could publish actions to FB users profiles, but my problem is that I have then 1900 broken links that users previously bookmarked, so my question is: Is there any way to make once I turn them to /%category%/%postname%.html and people try to access /%category%/%postname%/ the link gets redirected to /%category%/%postname%.html whether it be a function that changes last slash into .html (because that is the only change in the structure) or anything?

    So is there any way to accomplish that?

Viewing 4 replies - 1 through 4 (of 4 total)

    I would suggest using this plugin and when defining a new rule for 301, use the regular expression:

    Source URL: (.*)/(.*)
    Target URL: (.*)/(.*)\.html

    Pretty sure this will work. Unless you have pages that are like %postname%/comment-page-1 .

    Nope, the (.*)/(.*) not possible, nothing happens… it looked logical to me too… but no.

    If you do this you also run the risk of loosing any Google juice you’ve accumulated for your existing URLs.

    If you have lots of people linking to:

    Then this link will be ranked high in Google search results. Changing the URL will not only break inbound bookmarks and links, you will also lose valuable ranking weight.

    Solved the issue by changing the 404 page just added

    $dino_removed_slash = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
    $dino_removed_slash = rtrim($dino_removed_slash,'/')
    Proceed with the <a href="http://<?php echo $dino_removed_slash(); ?>.html">article</a>

    Unfortunately that is the only way, because opengraph api wont publish actions related to posts finishing with “/”… at least in my case.

    Hope this solution up there helps someone out there.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Premalinks change’ is closed to new replies.