Answer the question
In order to leave comments, you need to log in
How to do a proper htaccess redirect (XAMPP)?
UPD Closed. Figured it out myself.
I want to make sure that absolutely all requests are redirected to index.php, and they are already processed there, but for some reason, if you enter, for example, the request site.ru/page/page1.php, then it will simply bypass processing in index.php and open directly this page. If you enter even some wrong request, then it bypasses index.php again and directly gives a server error "Object not found!", Although I simply redirect to the main page in my index.php. Tell me what to do. Here is the HTACCESS content:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
Answer the question
In order to leave comments, you need to log in
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !page/page1.php$
RewriteRule .* index.php [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question