Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

access denied on localhost .htacces [closed]

Tags:

.htaccess

i have a private section where specific users can login on my system (restricted to 4 users)

i want to add IP restriction in the .htaccess using:

<Limit GET POST PUT>
order allow,deny
allow from 127.0.0.1
allow from 192.168
allow from 67.xx.xx
# etc..
deny from all
</Limit>

but i get this error:

Forbidden

You don't have permission to access / on this server.

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

when i try to access this site locally (i have lamp on my desktop installed, my host file is setup correctly and my apache config is good too)

if I go to my site locally i can see my site with mod-rewrite and errordocument. everything is working fine

why do i get an access denied when i put the restrictin?

like image 814
Trent Miller Avatar asked Feb 11 '12 20:02

Trent Miller


1 Answers

you can first deny and then allow:

order deny,allow

deny from all
allow from 127.0.0.1
allow from 192.168
allow from 67.xx.xx
# etc..

obviously I can not test with your setup, but that's what I do.

like image 166
Jörg Beyer Avatar answered Nov 01 '22 15:11

Jörg Beyer