Y
Y
Ysery2019-07-09 09:31:54
htaccess
Ysery, 2019-07-09 09:31:54

How to combine two rules in htaccess?

Good day, dear experts.
At the root of the site, in htaccess there are such lines

SetEnvIfNoCase User-Agent "BackupLand" bad_bot
SetEnvIfNoCase User-Agent "Nimbostratus-Bot" bad_bot
SetEnvIfNoCase User-Agent "Photon" bad_bot
<limit get="" post="" head="">
 Order Allow,Deny
 Allow from all
 Deny from env=bad_bot
</limit>

And in htaccess, which is in the images folder, such
Order deny,allow
    Deny from all
    <Files ~ ".(jpe?g|png|gif)$">
    Allow from all
    </Files>

And bots that are blocked are unblocked if they directly access the content in the images folder. How to fix it? Maybe add bot blocking to htaccess, which is located in the images folder? How then to combine these rules?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-07-09
@Ysery

/.htaccess

SetEnvIfNoCase User-Agent "BackupLand" bad_bot
SetEnvIfNoCase User-Agent "Nimbostratus-Bot" bad_bot
SetEnvIfNoCase User-Agent "Photon" bad_bot

Order Allow,Deny
Allow from all
Deny from env=bad_bot

/images/.htaccess
Deny from all

<Files ~ "\.(jpe?g|png|gif)$">
  Order deny,allow
  Deny from env=bad_bot
</Files>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question