.htaccess"此处不允许选项"

MrB*_*MrB 23 .htaccess options httpd.conf

我在.htaccess中有这个:

选项+ FollowSymLinks

我在apache error_log中收到以下错误:

.htaccess: Options not allowed here
Run Code Online (Sandbox Code Playgroud)

这是我的httpd.conf文件中的部分:

#htdocs symlinks here
<Directory /Users/you/code/my/folder>
    Options All
    AllowOverride All
</Directory>

<Directory />
    Options All
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

<Directory "/Applications/XAMPP/xamppfiles/htdocs">
    Options All 
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)

所以我在各处都设置了Options All和AllowOverride All,但是我仍然不允许设置选项.任何人都可以理解这个吗?

谢谢,MrB

小智 24

请注意,这是特定于XAMPP的问题.XAMPP加载一些位于XAMPP/etc/extra/覆盖httpd.conf的其他配置文件.对我来说,违规文件http-userdir.conf适用于〜用户请求的规则,并包含该行AllowOverride FileInfo AuthConfig Limit Indexes并更改该行AllowOverride All确实解决了我的问题.

这仅适用于从OS X上的/ Sites /目录提供的文件.我不知道Windows版本是否完全使用UserDir,或者甚至有类似的规则.


小智 6

就我而言,我最终将行更改AllowOverride AuthConfig FileInfoAllowOverride All文件 httpd-vhosts.conf ,该文件位于 apache\conf\extra 文件夹中


jma*_*man 2

我猜你的 apache 配置中有一个全局AllowOverride设置不允许这样做。你能在你的 httpd.conf 中 grep 查找AllowOverride吗?