I want to allow to see my localhost project over the LAN using Apache LIMIT directive in .htaccess

my localhost project URL is

below is the .htaccess part which cause problem

 order deny,allow
 deny from all
 allow from
 Satisfy any

but it gives error

Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

Error 500 Apache/2.4.10 (Unix) OpenSSL/1.0.1i PHP/5.5.15 mod_perl/2.0.8-dev Perl/v5.16.3

my error_log is

[Fri Dec 26 11:18:36.183915 2014] [core:alert] [pid 4752] [client] /opt/lampp/htdocs/myproject/.htaccess: The specified network mask is invalid.

my work around

  • If I set allow from it works only for my IP not over LAN

  • If I set allow from 192.168.0-5.0-255 then it works fine (expected) but only the main page is coming, after login it gives Access forbidden!403

whereas it was advised to use / on this blog and many other SO answers

Does this (/ to -) changed into apache 2.4 ?

someone kindly explain the differences of these and proper valid syntax, I didn't find it on Apache documentation.

another issue

When add GET in LIMIT option

 order deny,allow
 deny from all
 allow from

then it gives error everywhere

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

Error 403 Access forbidden!

errro_log is

[Fri Dec 26 11:34:05.840880 2014] [access_compat:error] [pid 4752] [client] AH01797: client denied by server configuration: /opt/lampp/htdocs/myproject/


I got the solution from this article

change the line

allow from to

allow from

will lock Apache down to my internal LAN i.e. address range to only with subnet mask of

and it works with GET also, here is my final .htaccess

 Order deny,allow
 Deny from all
 Allow from ::1
 Allow from

The satisfy directive is intended to combine multiple requirements i.e. both from your subnet and a valid-user .

Leave that option out and you should have a more valid configuration.

Also it is better to use your apache configuration file rather than .htaccess files.

  • already checked with removal of satisfy but error remains. And do not have access to Apache log on server that's why I used it on .htaccess – diEcho Dec 26 '14 at 8:20

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.