Support » Fixing WordPress » Changing Permalinks with 301 Redirect in HTACCESS?

  • Hopefully someone can help me. I have a 2 yr old site with about 100 posts. I have been trying to sort this out for days. I simply want to change my permalinks on my main site from /%category%/%postname%/ to just /%postname%/ and used the 301 Redirect generator over at Yoast to generate this code. I just wanted to make sure that code was correct.

    RedirectMatch 301 ^/([^/]+)/([^/]+)/$$2

    I also have W3 Total Cache installed.

    So Deactivate W3==>Change Permalinks Setting==>Add code to HTACCESS File. WHERE in the file does it go?

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    Any other steps? I have asked this in 3 different groups, and posted it on a few boards. I swear I feel like I am asking for Top Secret Missile Codes. I am sure I am over thinking this, but losing traffic and having a broken site for a few days is not something I want to deal with. Especially considering how long it took to get this answer.

  • The topic ‘Changing Permalinks with 301 Redirect in HTACCESS?’ is closed to new replies.