C
C
choodo2017-02-09 00:55:44
htaccess
choodo, 2017-02-09 00:55:44

Which rule will be the last one in htaccess?

To redirect from http to https, reg ru suggests the following rule:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,<b>L</b>]

The L flag will stop all htaccess parsing next? Do I understand correctly that it is better to remove it, tk. further rules for 3 more screens?
Example:
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

# BEGIN All In One WP Security
#AIOWPS_BASIC_HTACCESS_RULES_START
<Files .htaccess>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</Files>
ServerSignature Off
LimitRequestBody 10240000
<Files wp-config.php>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</Files>
#AIOWPS_BASIC_HTACCESS_RULES_END
#AIOWPS_PINGBACK_HTACCESS_RULES_START
<Files xmlrpc.php>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</Files>
#AIOWPS_PINGBACK_HTACCESS_RULES_END
#AIOWPS_DEBUG_LOG_BLOCK_HTACCESS_RULES_START
<Files debug.log>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-02-09
@shambler81

L is not what you thought.
Reading the .htacces file is quite specific.
And indeed L will be the last one for this reading cycle.
But there will be just as many read cycles until the changes in redirects stop. And while they are your l will not add anything.
you will not find clear and detailed information on mod_rewrite, it is everywhere in fits and starts.
However, read this article https://habrahabr.ru/company/sprinthost/blog/129560/
And think about each point. If you parse it for you, mod_rewrite will 90% stop behaving inappropriately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question