简体   繁体   中英

apache htaccess file rules

I am a bit confused with apache's htaccess file rules. If Lets say a user comes in, meets one of the rules in one of the two ifmodules, will it stop and not proceed to my ip blocks or other rules? example below.. A bit new with apache, and I just want to make sure I am doing this right.. I want it to process lets say this whole chain below..

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*yourdomainname.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^ttp://{REMOTE_ADDR}/$ [R=301,L]
</IfModule>

<Limit GET POST HEAD>
order allow,deny
#deny from 72.26.192.0 - 72.26.223.255
deny from 82.80.249.150
deny from 82.80.249
deny from 72.26
allow from all
</Limit>

I'm pretty sure that the <Limit> directive is processed at the connection time, before the URL is even read to be processed by the rewrite rule. Thus, the <Limit> is applied without regard to the URL in use (rewrite or no).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM