RewriteEngine on # Audit pages have exactly one segment after /www/: the audited domain. # Any deeper URL is a legacy pseudo-link and must disappear from indexes. RewriteRule ^[a-zA-Z]{2}/www/[^/]+/.+ - [G,L] RewriteRule ^www/[^/]+/.+ - [G,L] # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RedirectMatch 404 /\.git # otherwise forward it to index.php RewriteRule . index.php