簡體   English   中英

apache SetEnvIf Request_URI不起作用

[英]apache SetEnvIf Request_URI getting not working

當前在ubuntu上的apache服務器上運行的網站,現在整個網站都受到.htaccess身份驗證的保護。

想要做:我需要允許兩個URL無需身份驗證。

sites1.conf

<VirtualHost *:80>
...
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/(tools|manager)/
</VirtualHost>

<Directory /srv/site1/symfony/>
AuthType Basic
AuthName "My Area"
AuthBasicProvider file
AuthUserFile "/etc/apache2/passwords.htpwd"
Require user user1

SetEnvIf Request_URI ^/en/App/uploadImagesForm allow
Order allow,deny
Allow from env=allow
Satisfy any
</Directory>

網址:xxx.xxxx.xx:9005 / zh-CN / App / uploadImagesForm /

問題仍在詢問密碼

您可以禁用整個目錄的身份驗證

  <Directory "/srv/site1/symfony/public">
    AuthType None
    Require all granted
  </Directory>

要僅允許特定的URI,請將以下代碼添加到VirtualHost配置中。

<Location "/en/App/uploadImagesForm">
    AuthType None
    Require all granted
</Location>

有關更多詳細信息,請參閱Apache Sections Configuration文檔: http : //httpd.apache.org/docs/current/sections.html#file-and-web

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM