Answer the question
In order to leave comments, you need to log in
Why doesn't the .htaccess exception work?
Good night, tell me why the exception in the ..htaccess file does not work
RewriteEngine On
RewriteRule .* index.php
RewriteCond %{REQUEST_URI} !^/event/
RewriteCond %{HTTP:X-Forwarded-proto} !^https$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Answer the question
In order to leave comments, you need to log in
The request is compared one by one with the templates in the RewriteRule and the first match is redirected.
First rule RewriteRule .* index.php
The pattern .*
matches any string, so the request /event/test.php
will be redirected to index.php at the root of the site.
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-proto} !^https$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question