How do I redirect a directory to the root of a site? Provided that:
-
the root of the site is actually not the root of the domain. ex: it should redirect to ‘www.example.com/website’, not to ‘www.example.com’
-
don’t redirect subfolders. ex: it should redirect ‘www.example.com/website/portfolio’ to ‘www.example.com/website’, but it shouldn’t redirect ‘www.example.com/website/portfolio/project-name’.
It’s a WordPress site and it’s already working with the following rules:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /website/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /website/index.php [L]
</IfModule>
# END WordPress
Thanks in advance!
You can do: