繁体   English   中英

htaccess行-500错误

[英]htaccess line - 500 error

我有一个htaccess文件:

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

我想在下面添加一行,但这给了我500错误。

选项-索引

有人可以帮忙吗?

检查您的.htaccess所在的目录是否已在httpd.conf中启用了必要的AllowOverride (启用的必须为:AuthConfig和Options至少)。

确保它不在

<IfModule mod_rewrite.c>
...
</IfModule>

.htaccess的一部分

通常,您的错误日志中应该有一条日志消息。 我认为,您会发现类似以下内容:

[alert] [client 192.xxx.xxx.xxx] /path/to/web/.htaccess: Options not allowed here

此解决方案并不总是有帮助(取决于您使用的apache版本):在某些情况下,您必须将此部分移到httpd.conf才能起作用。

apache-docs中对此进行了详细说明。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM