Permalink Custom Structure 301 Redirect

Discussion in 'WordPress' started by mixhungama, Jun 25, 2012.

  1. #1
    Hello,

    Currently I am using Permalink Custom Structure i.e.

    /%category%/%postname%.html
    Code (markup):
    Now I want to remove .html from it so I did like this

    /%category%/%postname%/
    Code (markup):
    but the posts send to 404 page and I want to 301 redirect from old structure to new one. I tried few plugins to redirect but nothing works.

    Does anyone have the solution or suggestion?
     
    mixhungama, Jun 25, 2012 IP
  2. Imposter

    Imposter Peon

    Messages:
    169
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
  3. Praful.Kamble29

    Praful.Kamble29 Member

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Changing code to
    /%category%/%postname%/ only change the permalinks for new posts and not for existing ones.

    Tery below htacess rule:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.*).html\ HTTP/
    RewriteRule .* http://localhost/html/%1 [R=301,L]

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.*)\ HTTP/
    RewriteRule .* %1.html [L]
    </IfModule>
     
    Praful.Kamble29, Jun 25, 2012 IP
  4. mixhungama

    mixhungama Greenhorn

    Messages:
    82
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    The problem is not to change the permalinks for new posts and not for existing ones. I am able to change the permalinks for both new and old posts but not able to 301 redirect old posts to the new format i.e. http://www.mysite.com/post.html to http://www.mysite.com/post/
     
    mixhungama, Jun 25, 2012 IP
  5. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #5
    I'm not sure you'll be able to do that. You may have to bite the bullet and 301 redirect all your old .html posts to their new permalink structure.
     
    adbox, Jun 26, 2012 IP
  6. mixhungama

    mixhungama Greenhorn

    Messages:
    82
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #6
    Nothing is impossible dude. There should be a way to do that, I'm sure I'll find out the solution anyhow.
     
    mixhungama, Jun 26, 2012 IP
  7. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #7
    You're right I'm sorry. Please update us. I'm interested in your solution. The jump is complex though because the permalink system of Wordpress isn't designed to offer more than one option on old versus new post. Maybe you could permantly cache what's there and then change the permalink structure, or literally generate those html pages if there is a plugin that does it and then you can change the entire site's permalink system... but still parts of your in-page linking system will point to the new permalinks while old posts retain the old link structure in it's internal html links. Which might cause duplicate content issues. Just sayin this one is super trixy.

    Still, good luck. There probably is a better way.
     
    adbox, Jun 26, 2012 IP
  8. ashishkg

    ashishkg Active Member

    Messages:
    233
    Likes Received:
    8
    Best Answers:
    3
    Trophy Points:
    68
    #8
    yes you are right....
     
    ashishkg, Jun 26, 2012 IP