Answer the question
In order to leave comments, you need to log in
How to configure htaccess to give each IP its own 403 response text?
Hello.
There is a code in .htaccess :
ErrorDocument 403 "Вы заблокированы"
Order Allow,Deny
Allow from all
Deny from 00.000.000.00
Order Allow,Deny
Allow from all
Deny from 11.111.111.11 ErrorDocument 403 "Причина блокировки номер 1"
Deny from 222.222.222.222 ErrorDocument 403 "Причина блокировки номер 2"
Answer the question
In order to leave comments, you need to log in
Found a solution:
RewriteCond %{REMOTE_ADDR} ^000.00.00.000 [OR]
RewriteCond %{REMOTE_ADDR} ^111.11.11.111 [OR]
RewriteCond %{REMOTE_ADDR} ^222.22.22.222
RewriteCond %{REQUEST_URI} !(deny1.html) [NC]
RewriteRule (.*) /deny1.html [R=301,L]
RewriteCond %{REMOTE_ADDR} ^333.33.33.333 [OR]
RewriteCond %{REMOTE_ADDR} ^444.44.44.444
RewriteCond %{REQUEST_URI} !(deny2.html) [NC]
RewriteRule (.*) /deny2.html [R=301,L]
RewriteCond %{REMOTE_ADDR} ^555.55.55.555
RewriteCond %{REQUEST_URI} !(deny3.html) [NC]
RewriteRule (.*) /deny3.html [R=301,L]
Logic is just for the code, make a simple page in your favorite programming language and give out any text. This is clearly overkill for htaccess.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question