开发者

protect folders via htaccess

i want to protect some folders fro开发者_StackOverflow社区m a normal user but i (from localhost or my IP address) m unable to see the folder structure...so i do this

write a .htaccess file in that folder(eg.project/cms/js) and write below code

# no nasty crackers in here!
order deny,allow
deny from all
allow from 192.168.1.7

but by using this prohibit to everyone( including me) to see that folder structure..... how do i protect that folder from other users except myself?


I think you got the allow and deny the wrong way around:

order allow,deny
allow from 192.168.1.7
deny from all

which first processes all the allow statements and next the deny statements.


I just checked, your above example works fine for me on my Apache 2. Make sure your IP really is 192.168.1.7. Note that if it's the local machine you're trying to access, your IP will be 127.0.0.1.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜