• DinoCSP

    (@dinocsp)


    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)
  • saishuhane

    (@saishuhane)

    http://wordpress.org/extend/plugins/redirection/

    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 .

    Thread Starter DinoCSP

    (@dinocsp)

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

    thirstcard

    (@thirstcard)

    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:

    http://www.example.com/hello-world

    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.

    Thread Starter DinoCSP

    (@dinocsp)

    Solved the issue by changing the 404 page just added

    <?php
    $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.