Redirect directory (but not subdirectories) to another directory

How do I redirect a directory to the root of a site? Provided that:

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!

Related posts

Leave a Reply

1 comment

  1. You can do:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /website/
    
    RewriteRule ^portfolio/?$ /website/ [L,R]
    
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /website/index.php [L]
    </IfModule>