• i currently have my htaccess file working so i get permalinks like this:

    /blog/category/year/post-title

    however i became aware using category as first portion of permalink is not recommended due to performance issues so i want to change permalinks to be:

    /blog/year/category/post-title

    now i know all i need to do is change the permalinks to do so . . . however – my question is how do i modify the htaccess to not break incoming links so that

    /blog/category/year/post-title
    get a 301 redirect to
    /blog/year/category/post-title

    ????

Viewing 5 replies - 1 through 5 (of 5 total)
  • Post the current file so we can see what else is going on there.

    It will look something like

    RewriteRule ^blog/([^/]+)/(\d{4})/(.+)$ http://mysite.com/blog/$2/$1/$3 [R=permanent,L]

    Hi,

    Set your desired permalink and add this code in htaccess:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Thanks,

    Shane G.

    Ditto what Shane G said…

    Thread Starter richiedude

    (@richiedude)

    tried it shane & that does’t work

    what happens is all old incoming links to

    /blog/category/year/post-title

    forward to:

    /blog/

    and all posts – if you click on them, do not go to single post, just goes to /blog

    so that htaccess you suggested merely forward everything to
    /blog/

    Thread Starter richiedude

    (@richiedude)

    anyone?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘htaccess question’ is closed to new replies.