.htaccess“此处不允许使用选项"; [英] .htaccess "Options not allowed here"

查看:175
本文介绍了.htaccess“此处不允许使用选项";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的.htaccess文件中有此文件:

I have this in my .htaccess:

选项+ FollowSymLinks

Options +FollowSymLinks

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

And I get the following error in the apache error_log:

.htaccess: Options not allowed here

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

Here's the part from my httpd.conf file:

#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>

因此,我到处都设置了Options All和AllowOverride All,但是仍然不允许设置该选项.有人能理解吗?

So I'm setting Options All and AllowOverride All everywhere, but STILL I'm not allowed to set the option. Can anyone make sense of this?

谢谢, 先生

推荐答案

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

Note that this is a XAMPP-specific issue. XAMPP loads some additional configuration files located in XAMPP/etc/extra/ that override httpd.conf. For me the offending file is http-userdir.conf which applies rules for ~user requests and contains the line AllowOverride FileInfo AuthConfig Limit Indexes and changing that line to AllowOverride All did indeed solve my issue.

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

This only applies to files served from your /Sites/ directory on OS X. I don't know if the Windows version uses UserDir at all or even has a similar rule.

这篇关于.htaccess“此处不允许使用选项";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆