I developed a giant studio of tools and each tool has its own directory in the /tools/ folder. So if you have a tool named example, the URL would be /studio-dir/tools/e
In this example there is not 404 but it only works to hide only one dir
RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+dirname/([^\s]+) [NC] RewriteRule ^ %1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (?!^dirname/)^(.*)$ /dirname/$1 [L,NC]