Grow your CSS skills. Land your dream job.

Moving WordPress to the root directory; how to redirect old URLs

  • # July 28, 2012 at 2:49 pm

    A few years ago I started a website with WP installed in a subdirectory (let’s call it ‘/folder’) to keep the root clean. Now I want to apply the following tutorial: Giving WordPress Its Own Directory – Using a pre-existing subdirectory install. It’s easy to apply but I don’t want to lose my Google ranking. So how can I redirect the URLs with ‘/folder’ automatically to the root?
    For example: mydomain.com/folder/post-1 should redirect to the new URL mydomain.com/post-1, mydomain.com/folder/post-2 should redirect to the new URL mydomain.com/post-2 et cetera.

    I guess I can fix it in the .htaccess file with 301 redirects, but after some research I still haven’t found a working solution.

    # July 28, 2012 at 4:46 pm

    I’ve found this article on Perishable Press, with the following solution:
    RedirectMatch 301 ^/blog/$ http://domain.tld/

    It works for posts and pages, but not for the archive pages of categories, authors, and tags.

    # July 29, 2012 at 7:00 am

    There is a plugin called “Duplicator” that makes moving WordPress websites extremely easy. I tried it other the other day, worked flawlessly.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".