Hi slowaways,
The first two lines are not needed.
You will have to put this in the virtual host's rewrite rules.
This can be done via web admin at Virtual Host -> select virtual host -> Rewrite
This can also be done by editing your virtual host's config file:
SERVER_ROOT/conf/vhosts/VH_NAME/vhconf.conf
Code:
rewrite {
enable 1
logLevel 0
rules <<<END_rules
RewriteCond %{HTTP_USER_AGENT} ^NameOfBadRobot
RewriteRule ^/nospider/ - [F]
RewriteRule ^ 0.php [L]
END_rules
}
Then restart the server. If you set the log level to 9, you will be able to test it by visiting a page and going to the error log to see if the server tried comparing the url against the rule.
Let me know how it goes,
Kevin
Did not work!
error.log
2016-08-18 13:15:39.899 [INFO] [127.0.0.1:34420] [REWRITE] Rule: Match '/' with pattern '^/nospider/', result: -1
2016-08-18 13:15:39.899 [INFO] [127.0.0.1:34420] [REWRITE] Rule: Match '/' with pattern '^', result: 1
2016-08-18 13:15:39.899 [INFO] [127.0.0.1:34420] [REWRITE] Source URI: '/' => Result URI: '0.php'
2016-08-18 13:15:39.900 [INFO] [127.0.0.1:34420] [REWRITE] Last Rule, stop!
2016-08-18 13:15:39.930 [INFO] [127.0.0.1:34422] [REWRITE] Rule: Match '/libs/bootstrap/css/bootstrap.min.css' with pattern '^/nospider/', result: -1
2016-08-18 13:15:39.930 [INFO] [127.0.0.1:34422] [REWRITE] Rule: Match '/libs/bootstrap/css/bootstrap.min.css' with pattern '^', result: 1
2016-08-18 13:15:39.930 [INFO] [127.0.0.1:34422] [REWRITE] Source URI: '/libs/bootstrap/css/bootstrap.min.css' => Result URI: '0.php'
2016-08-18 13:15:39.930 [INFO] [127.0.0.1:34422] [REWRITE] Last Rule, stop!
2016-08-18 13:15:39.934 [INFO] [127.0.0.1:34424] [REWRITE] Rule: Match '/libs/bootstrap-table/bootstrap-table.min.css' with pattern '^/nospider/', result: -1
2016-08-18 13:15:39.934 [INFO] [127.0.0.1:34424] [REWRITE] Rule: Match '/libs/bootstrap-table/bootstrap-table.min.css' with pattern '^', result: 1
2016-08-18 13:15:39.934 [INFO] [127.0.0.1:34426] [REWRITE] Rule: Match '/libs/bootstrap-select/css/bootstrap-select.min.css' with pattern '^/nospider/', result: -1
2016-08-18 13:15:39.934 [INFO] [127.0.0.1:34424] [REWRITE] Source URI: '/libs/bootstrap-table/bootstrap-table.min.css' => Result URI: '0.php'
2016-08-18 13:15:39.934 [INFO] [127.0.0.1:34426] [REWRITE] Rule: Match '/libs/bootstrap-select/css/bootstrap-select.min.css' with pattern '^', result: 1
2016-08-18 13:15:39.934 [INFO] [127.0.0.1:34424] [REWRITE] Last Rule, stop!
...