Apache 使用.htaccess保护“友好URL”
我想保护htaccess文件中的友好url。更清楚一点,我有以下规则: 重写规则^[a-z | a-z | 0-9 | \/| \-| \+$index.php?页面=$1 将url/test/hello重定向到index.php?page=test/hello 我想做的是,例如,当一个certanin url被给出时,例如,url/text/hello url/研究所 浏览器会提示用户和密码对话框,与处理htacces文件中的目录的方式相同 我试过:Apache 使用.htaccess保护“友好URL”,apache,.htaccess,security,friendly-url,.htpasswd,Apache,.htaccess,Security,Friendly Url,.htpasswd,我想保护htaccess文件中的友好url。更清楚一点,我有以下规则: 重写规则^[a-z | a-z | 0-9 | \/| \-| \+$index.php?页面=$1 将url/test/hello重定向到index.php?page=test/hello 我想做的是,例如,当一个certanin url被给出时,例如,url/text/hello url/研究所 浏览器会提示用户和密码对话框,与处理htacces文件中的目录的方式相同 我试过: <LocationMatch "/i
<LocationMatch "/institucional">
AuthType Basic
AuthName "Padres Secundaria"
AuthUserFile /url/to/file.passwd
Require valid-user
</LocationMatch>
但是它给了我一个500错误页。请不要在/institucional周围加引号。查看文档,对于这种类型的指令,在模式周围没有引号。