# Rederection if URL not found RewriteEngine on RewriteCond %{REQUEST_FILEANME} !-f RewriteCond %{REQUEST_FILEANME} !-d RewriteRule (.+) index.php?p=$1 [QSA,L] # Redirecting 403 errors to index.php (does not work) ErrorDocument 403 http://localhost:8888/api-rest/index.php # Refusing access to all files ending with php Require all denied # Allowing access to index.php Require all granted