English 中文(简体)
• 如何允许单一尿素,但限制使用猎取的其他人
原标题:How to allow a single url but restrict the others using htaccess

I am trying to allow a single location (a file which does not exist) to be accessed on my Apache 2.2.3 (Centos) server to be able to implement the paypal ipn listener. The other files should stay password protected.

www.un.org/Depts/DGACM/index_spanish.htm 如何允许在没有标识的情况下进入单一地点?

法典简略显示了我迄今为止所尝试的内容。

地点指令选择了正确的地点(我通过书面方式测试,从所有人那里否认)。

www.un.org/Depts/DGACM/index_french.htm 服务器仍在要求为这一地点提供密码。

我已经试图将地点指令放在名录中,但这会导致yn误(即使允许档案指令),但I 不能使用文件指令,而是使用一个地点,因为档案实际上不存在。

<Directory /var/www/vhosts/somedomain.net/subdomains/p103.myproject/httpdocs/public>
Order Deny,Allow
 Options -Includes -ExecCGI
 SetEnv APPLICATION_ENV "development"
 AuthName "myproject"
 AuthType Basic
 AuthUserFile /var/www/vhosts/somedomain.net/subdomains/p103.myproject/.htpasswd
 AuthGroupFile /var/www/vhosts/somedomain.net/subdomains/p103.myproject/.htgroups
 Require group myproject
</Directory>
DocumentRoot /var/www/vhosts/somedomain.net/subdomains/p103.myproject/httpdocs/public
<Location "/ipn/sdsad8329ejslkdjasl">
 Order Deny,Allow
 Allow from all
 Satisfy Any
</Location>

http://www.un.org/docs/2.2/ rel=“nofollow”

最佳回答

您可使用<代码>SetEnvIf,与请求一致。 URI要设定一个变量,然后使用的组合。 Satisfy any ,Require group myproject and Allow

类似情况:

DocumentRoot /var/www/vhosts/somedomain.net/subdomains/p103.myproject/httpdocs/public

# Here we check if the request is for something we don t need to authorize
SetEnvIf Request_URI ^/ipn/sdsad8329ejslkdjasl NO_AUTH_NEEDED=1

<Directory /var/www/vhosts/somedomain.net/subdomains/p103.myproject/httpdocs/public>
  Order Allow,Deny
  Options -Includes -ExecCGI
  SetEnv APPLICATION_ENV "development"
  AuthName "myproject"
  AuthType Basic
  AuthUserFile /var/www/vhosts/somedomain.net/subdomains/p103.myproject/.htpasswd
  AuthGroupFile /var/www/vhosts/somedomain.net/subdomains/p103.myproject/.htgroups

  # This makes it so one of the 2 is good enough
  Satisfy Any
  # We allow first, but only if the NO_AUTH_NEEDED is set
  Allow from env=NO_AUTH_NEEDED
  # Otherwise, require a login
  Require group myproject

</Directory>
问题回答

暂无回答




相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签