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.
For example:
mydomain.com/folder/post-1should redirect to the new URLmydomain.com/post-1,mydomain.com/folder/post-2should redirect to the new URLmydomain.com/post-2et 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.
RedirectMatch 301 ^/blog/$ http://domain.tld/It works for posts and pages, but not for the archive pages of categories, authors, and tags.