Forbidden is showing 500 status instead of 403

Viewed 25

I have added the following rule to block all the IP coming to my website

RewriteEngine On
RewriteMap map "txt:/usr/local/apache2/conf/conf.d/blacklist.txt"
RewriteCond ${map:%{REMOTE_ADDR}} ^b$            [NC]
RewriteRule .* - [F,L]

the blacklist.txt looks like

1.1.1.1 b

The blocking is working fine and getting the Forbidden page but in log, we are getting 500 status code. Is there any way to resolve this? I need to get 403 status for Forbidden pages.

0 Answers
Related