我有一个像一样重写URLS的应用程序
domain.com/managedomain.com/backend
这些目录实际上并不存在,所以我不能在其中放置.htaccess文件来对其进行密码设置。
知道我如何要求.htaccess对所有匹配的url进行登录提示吗?
www.domain.com/manage/*
www.domain.com/backend/*
domain.com/manage/*
domain.com/backend/*
如果你还知道一种通过IP忽略.htaccess登录提示的方法,那也会很有帮助。
您可以使用带有身份验证的SetEnvIfNoCase
:
SetEnvIfNoCase Request_URI ^/?(manage|backend)/ SECURED
AuthType Basic
AuthName "My Password Area"
AuthUserFile /full/path/to/passwords
Require valid-user
Satisfy any
Order Allow,Deny
Allow from all
Deny from env=SECURED