小编pyr*_*yro的帖子

apache:重写前的基本身份验证

我在前端有一个apache,通过重写规则重定向请求.我必须在重定向请求之前进行基本身份验证,所以我把它放在配置文件中:

<VirtualHost *:443>
    ServerAdmin xxxxxx
    DocumentRoot /var/www/html/
    ServerName xxxxxxx
    RewriteEngine on
    ErrorLog logs/error.log
    CustomLog logs/access_log common

    <Directory /var/www/html/>
        AuthType Basic
        AuthName "Restricted Files"
        AuthUserFile /etc/httpd/conf/tag.pwd
        Require valid-user
        RewriteRule ^/(.*) http://xxxxxx:xxx/$1   [P,L]
    </Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

但是不起作用.

有什么建议?

apache mod-rewrite basic-authentication

9
推荐指数
2
解决办法
2万
查看次数

标签 统计

apache ×1

basic-authentication ×1

mod-rewrite ×1