Php CentOS Apache.htaccess:此处不允许选项(500-内部服务器错误)
我正在CentOS 7中安装Apache,这是我的httpd.conf- 这是我的文档根目录:/home/host/public\u html 为了测试Php CentOS Apache.htaccess:此处不允许选项(500-内部服务器错误),php,apache,.htaccess,mod-rewrite,centos7,Php,Apache,.htaccess,Mod Rewrite,Centos7,我正在CentOS 7中安装Apache,这是我的httpd.conf- 这是我的文档根目录:/home/host/public\u html 为了测试.htaccess文件是否有效&如果启用了mod\u rewrite,我已将示例.htaccess从一个laravel项目上载到/home/host/public\u html/.htaccess,其中包含以下内容: <IfModule mod_rewrite.c> <IfModule mod_negotiation.c
.htaccess
文件是否有效&如果启用了mod\u rewrite
,我已将示例.htaccess
从一个laravel项目上载到/home/host/public\u html/.htaccess
,其中包含以下内容:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
当我访问http:///index.php
,我得到以下错误:
500内部服务器错误
我在/var/log/httpd/apache\u error\u log
文件中找到了以下内容:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride Options
Order allow,deny
allow from all
</Directory>
[Thu Dec 31 15:50:43.696465 2015][core:alert][pid 23807][client xxx.xxx.xxx.xxx:56536]/home/host/public_html/.htaccess:此处不允许选项
如果我从.htaccess
文件中删除以下行:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride Options
Order allow,deny
allow from all
</Directory>
选项-多视图
脚本似乎已加载,没有错误
有什么问题吗?.htaccess:Options not allowed here错误表示不允许htaccess文件使用Options指令更改设置 要修复此错误,请编辑apache配置文件
/etc/httpd/conf/httpd.conf
:-
选项索引跟随符号链接多视图
允许超车选项
命令允许,拒绝
通融
将“选项”添加到AllowOverride列表将允许在htaccess文件中使用选项指令
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride Options
Order allow,deny
allow from all
</Directory>