小编Vis*_*ngh的帖子

.htaccess:此处不允许订购

我正在尝试将身份验证用于访问apache2中的文档根目录...这是我的配置文件

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        AccessFileName .htaccess
        DocumentRoot /home/user/workspace
        <Directory />
                Options FollowSymLinks
                AllowOverride None.htaccess
        </Directory>
        <Directory /home/vishu/workspace>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride AuthConfig
                Order allow,deny
                allow from all
        </Directory>
......
......

</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

这是/ home/user/workspace文件夹中的.htaccess文件:

<FilesMatch >
.....
</FilesMatch>

    AuthType Basic
    AuthName "MY ZONE"
    #AuthBasicProvider file
    AuthUserFile /home/vishu/workspace/passwordfile
    AuthGroupFile /dev/null
    Require valid-user
.....
...
Run Code Online (Sandbox Code Playgroud)

Apache .htaccess:order not allowed here出错,我从浏览器收到500错误.

.htaccess apache2

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

标签 统计

.htaccess ×1

apache2 ×1