WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2026 Poal.co

1.2K

I'm trying to create a web page that's only accessible by the local lan. I've been able to do this, but I'd like to provide an error page for those who hit it from outside the local lan, as the server also provides access to resources for those outside the local network. This is what I have:

Alias /in "/var/www/inside" <Directory /var/www/inside/> ErrorDocument 403 /var/www/403/index.html Require ip 192.168.1 </Directory>

This works, but because it's being denied to everything except local lan, the error document handling returns an error that states it can't handle the request because of the require IP directive:

Forbidden

You don't have permission to access this resource.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Is there a way to have apache handle the error gracefully and direct the user to an error page? I don't want people outside the lan realizing there's some restricted access page there, it's just going to redirect to an image.

edit: solved: https://poal.co/s/AskPoal/575563/8809541a-27d3-49c4-895b-190f5b66f403#cmnts

I'm trying to create a web page that's only accessible by the local lan. I've been able to do this, but I'd like to provide an error page for those who hit it from outside the local lan, as the server also provides access to resources for those outside the local network. This is what I have: >Alias /in "/var/www/inside" ><Directory /var/www/inside/> >ErrorDocument 403 /var/www/403/index.html >Require ip 192.168.1 ></Directory> This works, but because it's being denied to everything except local lan, the error document handling returns an error that states it can't handle the request because of the require IP directive: >Forbidden > >You don't have permission to access this resource. > >Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request. Is there a way to have apache handle the error gracefully and direct the user to an error page? I don't want people outside the lan realizing there's some restricted access page there, it's just going to redirect to an image. edit: solved: https://poal.co/s/AskPoal/575563/8809541a-27d3-49c4-895b-190f5b66f403#cmnts

(post is archived)

[–] 0 pt

I'd do this in code and probably base this off a secret.. Cookie or something like that. Folks with the right cookie/ip address continues to use the site ; others get a webpage that returns a 403 with a nice fuck off message