I had my wordpress website under a folder inside my domain root http://example.com/oldfolder/. Now I have changed the wordpress folder's name to http://example.com/newfolder/ and I need to create redirects for my posts which were shared on facebook because on Facebook they point to http://example.com/oldfolder. I need to create a redirect so that if a user click on the facebook post it redirects him from http://example.com/oldfolder/index.php/post-category/the-post-tile/ to http://example.com/newfolder/index.php/post-category/the-post-tile/
I have tried the following redirect rules:
- Redirect 301 /oldfolder/ http://example.com/newfolder/
- RewriteRule ^/oldfolder/^(.*) /newfolder/$1 [L,R=301]
- RedirectMatch 301 /oldfolder/^(.*) /newfolder/$1
But none of the above worked. I installed the WP redirection plugin but it also didn't work.
Could some please tell me how properly set up the redirect rules?
Thank you!