如何使用密码保护整个网站,但允许公众访问1个特定文件 [英] How to password protect an entire website but allow public access to 1 specific file

查看:81
本文介绍了如何使用密码保护整个网站,但允许公众访问1个特定文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个使用Paypal接受付款的电子商务网站.我正在测试阶段,因此我使用htaccess对整个站点进行了密码保护.问题在于我正在使用IPN验证PayPal付款,因此我的IPN脚本需要公开访问,以便PayPal可以与其通信.

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.

除了允许公众访问1个脚本文件之外,是否可以使用密码保护整个网站? (我的ipn脚本文件)

我正在使用PHP,这是我用来密码保护整个网站的.htaccess文件:

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

推荐答案

将IPN脚本放入具有自己的.htaccess的子目录中,该子目录显式禁用该文件夹内容的HTTP身份验证吗?

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

这篇关于如何使用密码保护整个网站,但允许公众访问1个特定文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆