This type of question has been asked in SO before but the offered solutions do not work for me. How can I remove this directory/folder from url with htaccess rewrite?
I have a multi site wordpress install that I have inherited and it has a single .htaccess file in the root directory of the site.
I need to do a global redirect on all URLs like this http:thewebsite.com/jol/blog/author/myles/
to go to http:thewebsite.com/jol/author/myles/
So far I have tried this code in the .htaccess file:
# BEGIN WordPress
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# Remove subdirectory of "blog" from URLs
RewriteCond %{THE_REQUEST} \ /blog/
RewriteRule ^blog/(.*)$ /$1 [L,R=301]
and this code:
# BEGIN WordPress
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{THE_REQUEST} \ /blog/
RewriteRule ^blog/(.*)$ /$1 [L,R=301]
and lastly, this code:
# BEGIN WordPress
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^blog/(.*)$ /$1 [R=301,NC,L]
and absolutely none of them work at all. The only thing that has been successful so far is targeting each URL individually and performing a redirect, which is...PAINFUL.
Any help would be hugely appreciated.