ErrorDocument failing to load

MentaL

Well-Known Member
#1
Hi

I want a custom 403 error page to output and I'm having great difficulty in getting it to work. I've tried to insert into .htaccess and httpd.conf and still no joy, the error page is ignored and the hardcoded 403 from Litespeed is displayed

Suggestions?
 

NiteWave

Administrator
#4
it should relate to override

check if
AllowOverride None
exists somewhere in httpd.conf. then change to
AllowOverride All

restart lsws
 

NiteWave

Administrator
#8
here's Mental's case:
1. put bad IP in
lsws web admin -> Server -> Security -> Denied List
2. expectation:
when the bad IP access the web server (any domain on it), the server return customized 403 error html page.

my comments:
1. when bad IP in server level "Denied List" access any of the website, lsws will reset the connection at once, won't do any further operations, like looking for which virtual host or which error page etc. in firefox, the message is "The connection was reset". this is why customized 403 page not work in this case.

2.when adding an bad IP in "Denied List", it requires a lsws restart, this is not efficient at all.
best to bad this IP at OS firewall, it's much more efficient. and no need restart firewall. here's the command FYI:
#iptables -I INPUT -s bad-ip-address -j DROP

3. tested and confirmed ErrorDocument works as apache.
 

MentaL

Well-Known Member
#9
Thanks for the assistance but sadly the presented method is not exactly what I'm wanting to do. I want all IPs blocked via Litespeed to be issued the predefined 403 page.
 
#10
that's fine. you can ban it in .htaccess

RewriteCond %{REMOTE_ADDR} ^1.1.1.1$ [OR]
RewriteCond %{REMOTE_ADDR} ^2.2.2.2$
RewriteRule .* - [F,L]

the customized 403 page will be returned for access from bad IPs.

so only need update .htaccess when adding a new bad IP, which lsws restart is not required.

note: put above rules at the very begining of .htaccess.
 
Top