How to password protect an entire website but allow public access to 1 specific file

 ̄綄美尐妖づ 提交于 2019-12-07 02:54:37

问题


I've created an e-commerce site that uses paypal to accept payment. I am in the testing phase so I have password protected the entire site using htaccess. The trouble is that I am using IPN to verify PayPal payments and therefor my IPN script needs to be publicly accessible so that PayPal can communicate with it.

Is there a way to password protect the entire website except allow public access to 1 script file? (my ipn script file)

I'm using PHP and here is my .htaccess that I'm using to password protect the entire site:

AuthName "Site Administratrion"
AuthUserFile /dir/.htpasswd
AuthGroupFile /dev/null

AuthName secure
AuthType Basic
require user username1
order allow,deny
allow from all

回答1:


Put the IPN script in a subdirectory with its own .htaccess that explicitly disables HTTP authentication for the contents of that folder?



来源:https://stackoverflow.com/questions/1431313/how-to-password-protect-an-entire-website-but-allow-public-access-to-1-specific

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!