Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Moving WordPress to the root directory; how to redirect old URLs

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39114
    Khalid
    Member

    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.

    #106942
    Khalid
    Member

    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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Other’ is closed to new topics and replies.