我的.htaccess文件不工作。看起来mod_rewrite模块没有加载。
一种检查这个以运行<?php phpinfo() ?>的方法。
但是,当我这样做时,phpinfo页面会出现问题,但是没有“apache2处理程序”的部分。因此,我无法检查mod_rewrite模块是否已加载。我看不出加载了哪个apache配置文件。
有人能帮我吗?我被这个问题困了好几个小时了。
这是我的.htaccess
RewriteEngine On
#exclusions
RewriteCond %{REQUEST_URI} !images/
RewriteCond %{REQUEST_URI} !external/
RewriteCond %{REQUEST_URI} !css/
#redirect everything else
RewriteRule ^(.*) index.php
Options -Indexes它被放置在一个网站的子文件夹中,比如www.example.com/sub文件夹/这个.thaccess文件工作在localhost和其他网站上。
这导致了一个500错误。
<IfModule mod_rewrite.c>
if mod_rewrite is enabled, you'll get 500 error on the server
</IfModule>编辑我发现这里没有运行在服务器上的,它的IIS.不管怎样,谢谢你的帮助。
发布于 2012-01-28 12:52:29
如果您怀疑mod_rewrite没有在您的apache上工作,并且无法在phpinfo()中检查它,那么还有很多方法来检查它。如果您没有对服务器的终端访问权限,可以通过.htaccess进行检查
<IfModule mod_rewrite.c>
if mod_rewrite is enabled, you'll get 500 error on the server
</IfModule>https://stackoverflow.com/questions/9045299
复制相似问题