RewriteEngine On RewriteCond %{SCRIPT_URL} !-f RewriteRule ^/(.*)$ /e/index.php [R,L] ## The result: if a file does not exist there is no redirection, but a regular 404 error page.