Answer the question
In order to leave comments, you need to log in
How to transfer all requests to index.php through htaccess, except for 404?
I need all requests to be redirected to index.php, and in case of a response, the server 404 is redirected to 404.html.
Tried like this:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/templates/
RewriteCond %{REQUEST_URI} !^/uploads/
RewriteCond %{REQUEST_URI} !^/panel/
RewriteCond %{REQUEST_URI} !^/ajax/
ErrorDocument 404 /404.html
RewriteRule ^((?!index\.php).+)$ /index.php [L]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question