开发者

htaccess protect all website but some paths

I need to protect all http://domain.com with AuthType Basic, but leave http://domain.com/foo/bar (http://domain.com/foo/bar is a rewrite url, not a folder)

I read about location tag but it not work in htaccess file :开发者_JS百科(.


RewriteCond %{REQUEST_URI} !^(foo/bar)
-- protect howsoever you want --


I found the answer:

SetEnvIfNoCase REQUEST_URI "/foo/bar" ExcludePath

AuthName "SiteName Administration"
AuthUserFile /.htpasswd
AuthType basic
Require valid-user

Order deny,allow
Deny from all
Allow from env=ExcludePath
Satisfy Any
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜