Monday, June 4, 2012

access denied on localhost .htacces


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?


Source: Tips4all

1 comment:

  1. 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.

    ReplyDelete