[resolved] I moved WordPress to a new folder. How do I get the old permalinks to redirect? (3 posts)

  1. 123-pet
    Posted 7 years ago #

    I had wordpress installed in http://www.domain.com/blog/

    I moved it to the root folder. I have about 20 posts indexed in the search engines, and I want those link to work. Is there a way to have the old permalinks which are indexed to redirect to the new directory?

    For example: http://www.domain.com/blog/12/name-of-post/ should redirect to http://www.domain.com/12/name-of-post/

    I just want to get rid of the "/blog" in the URL for the old indexed pages.

    Any ideas? Please?

  2. Firas
    Posted 7 years ago #

    If you're on Apache you can add this to your .htaccess before the WP rewriterules:

    RewriteBase /
    RewriteRule ^blog/(.*) /$1 [R=301,L]

  3. 123-pet
    Posted 7 years ago #

    Firas. That's PERFECT. It does exactly what I wanted it to do. Thanks so much!

Topic Closed

This topic has been closed to new replies.

About this Topic