Forum Moderators: phranque
<Location />
SetEnvIfNoCase User-Agent ".*ahrefsbot" badbot
SetEnvIfNoCase User-Agent ".*Alexibot" badbot
SetEnvIfNoCase User-Agent ".*archive.org_bot" badbot
SetEnvIfNoCase User-Agent ".*BlackWidow" badbot
etc etc etc
Require expr %{HTTP_USER_AGENT} != 'badbot'
</Location>
<Files "robots.txt">
Order Allow,Deny
Allow from all
</Files>
Require all granted
and that's all, isn't it? afaik there hasn't been any change to the <Files> locution as such. User-Agent ".*blahblah"
Sorry, your changes have introduced a syntax error in pre_virtualhost_global.conf. Please correct the issue.
Error:
Configuration problem detected on line 554 of file /usr/local/apache/conf/includes/pre_virtualhost_global.conf.tmp:Require not allowed here --- /usr/local/apache/conf/includes/pre_virtualhost_global.conf.tmp --- 548SetEnvIfNoCase User-Agent ".*wotbox" badbot 549SetEnvIfNoCase User-Agent ".*xxxyy" badbot 550SetEnvIfNoCase User-Agent ".*yandexbot" badbot 551SetEnvIfNoCase User-Agent ".*youda" badbot 552SetEnvIfNoCase User-Agent ".*zmeu" badbot 553SetEnvIfNoCase User-Agent ".*zune" badbot 554 ===> Require expr %{HTTP_USER_AGENT} != 'badbot' <=== 555 556# JAL Sets Files for Mod Deflate January 29 2016 557 558SetOutputFilter DEFLATE 559 560# JAL Mod Deflate --- /usr/local/apache/conf/includes/pre_virtualhost_global.conf.tmp ---
<Location> sections are processed in the order they appear in the configuration file, after the <Directory> sections and .htaccess files are read, and after the <Files> sections.