WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 301 Redirect for new permalink structure (3 posts)

  1. Ryann Micua
    Member
    Posted 2 years ago #

    Hi,

    I'd like help on putting in a 301 redirect into my htaccess file. My old permalink structure was:

    http;//www.example.com/blog/post-name

    I'd like it to be

    http://www.example.com/post-name

    What do I put in my .htaccess file?

    Thank you so much for taking the time to help.

  2. Pretty simple :)

    RewriteRule ^blog/(.*)$ http://example.com/$1 [L,R=301]

    This says 'ANYTHING that starts with blog/ gets punted back to just /'

    Put that ABOVE the 'BEGIN WORDPRESS' comment in your .htaccess :)

  3. Ryann Micua
    Member
    Posted 2 years ago #

    sweet!! thanks so much!

Topic Closed

This topic has been closed to new replies.

About this Topic