ErrorDocument 401 /401.php
ErrorDocument 404 /404.php
RewriteEngine On



#ignore existing files and directories
RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule .* - [L]

# Check if query string exists
RewriteCond %{QUERY_STRING} ^$

# Check that the request is not for an existing file
RewriteCond %{REQUEST_FILENAME} !-f

