Mod rewrite mod rewrite+;d错误

Mod rewrite mod rewrite+;d错误,mod-rewrite,apache2,Mod Rewrite,Apache2,我正在使用此.htaccess文件: RewriteEngine on RewriteCond %{REQUEST_URI} .(html|php)$ [OR] RewriteCond -d RewriteRule (.*) /index.php?s=$1 [L,QSA] 如果我试图访问一个受规则影响的站点,我会得到一个500服务器错误 我的日志说: [Fri Dec 17 13:40:43 2010][alert][client 127.0.0.1]C:/xampp/htdocs/.htac

我正在使用此.htaccess文件:

RewriteEngine on
RewriteCond %{REQUEST_URI} .(html|php)$ [OR]
RewriteCond -d
RewriteRule (.*) /index.php?s=$1 [L,QSA]
如果我试图访问一个受规则影响的站点,我会得到一个500服务器错误

我的日志说:

[Fri Dec 17 13:40:43 2010][alert][client 127.0.0.1]C:/xampp/htdocs/.htaccess:RewriteCond:bad参数行'-d'

如果我访问类似的内容:

没问题


有人能帮我吗?

重写条件需要如下所示:

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond需要两个参数我得到:[Fri Dec 17 13:46:41 2010][error][client 127.0.0.1]由于可能的配置错误,请求超出了10个内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用“LogLevel debug”获取回溯。@Philipp这是因为您构建了一个无限循环:index.php也被重定向。如果您想为不存在的文件重写URL,请使用
-f
而不是
-d
@Philipp
-d
=是现有目录
-f
=是现有文件
-s
=是现有符号链接如果我使用-f我得到[Fri-Dec 17 13:52:04 2010][alert][client 127.0.1]C:/xampp/htdocs/.htaccess:RewriteCond:bad参数行'-f':x我想转发带有.html和.php的文件以及文件夹,例如www.example.com/folder=>www.example.com/index.php?s=folder@Philipp显示您正在使用的整个行。您正在使用
请求文件名
,对吗?