smth.com/databox_sync
,我想从htaccess验证中排除这个网址。我的htaccess看起来像这样:
AuthUserFile /var/www/clients/client1/web3/web/domains/akomin.cz/.htpasswd
AuthType Basic
AuthName "My restricted Area"
# set an environt
ment variable "noauth" if the request starts with "/callbacks/"
SetEnvIf Request_URI ^databox_sync noauth=1
Order Deny,Allow
Satisfy any
Deny from all
Require valid-user
Allow from env=noauth
RewriteEngine on
#RewriteRule ^(.*)$ /Symfony/web/$1 [L,NE]
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
我通过cron调用此地址但cron返回:
"此外,需要401授权...."
答案 0 :(得分:0)
将您的SetEnvIf
行更改为:
SetEnvIf Request_URI ^/(databox_sync|index\.php$) noauth=1
这是因为您在最后一条规则中将所有内容都路由到index.php
,因此databox_sync
也会路由到它。