WordPress.org

Ready to get started?Download WordPress

Forums

Changing Permalinks with 301 Redirect in HTACCESS? (1 post)

  1. kalel35
    Member
    Posted 10 months ago #

    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 ^/([^/]+)/([^/]+)/$ http://domain.com/$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]
    </IfModule>
    
    # 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.

Reply

You must log in to post.

About this Topic