Php htaccess url重写失败

Php htaccess url重写失败,php,.htaccess,Php,.htaccess,我得到这个错误: Internal server error. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. 当我运行时,我可以看到mod_rewrite显示为“加载的模块” 这是我的htaccess规则,我想将任何无法解析/找到的url发送到index.php RewriteEngin

我得到这个错误:

 Internal server error. Internal Server Error
 The server encountered an internal error or misconfiguration
 and was unable to complete your request. 
当我运行时,我可以看到mod_rewrite显示为“加载的模块”

这是我的htaccess规则,我想将任何无法解析/找到的url发送到index.php

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
Rewritecond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [NC,L]

有人能帮我调试一下吗?我被卡住了…

以下是我通常做的事

RewriteEngine On
# ignore rules if URL is file
RewriteCond %{REQUEST_FILENAME} !-f
# ignore rules if URL is directory
#RewriteCond %{REQUEST_FILENAME} !-d
# ignore rules if URL is not php
#RewriteCond %{REQUEST_URI} !\.php$

# catch-all for routing
RewriteRule . index.php

如果您在WAMP localhost中,则需要配置“httpd.conf”。

检查日志文件(在vhosts文件或站点可用文件中找到它们)以获取错误。您的.htaccess似乎没有问题。

OP没有将参数传递到index.php,因此您是否有匹配类并不重要。请尝试。不,它与我的原始帖子中描述的问题相同。您需要检查apache错误日志,以查看真正的错误是什么:在httpd.config或站点启用文件中启用允许覆盖所有内容htaccess文件在哪里,以及当您尝试直接访问
index.php
时会发生什么?