Apache .htaccess重定向结果为404

Apache .htaccess重定向结果为404,apache,.htaccess,mod-rewrite,redirect,Apache,.htaccess,Mod Rewrite,Redirect,我想将所有流量重定向到index.php 这是我的.htaccess文件代码: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] RewriteCond %{QUERY_STRING} (\<|%3C).*script.

我想将所有流量重定向到
index.php

这是我的
.htaccess
文件代码:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ /null.php [F,L]

php_value date.timezone "Asia/Jerusalem"
php_value expose_php off
php_value serversignature off
php_flag servertokens OS


RewriteCond %{REQUEST_URI}  !(\.png|\.jpg|\.gif|\.jpeg|\.bmp|\.js|\.css|\.txt|\.pdf|\.zip|\.doc|\.docx)$
RewriteRule ^(.*)$ index.php?url=$1 [NC,QSA]
Options+FollowSymLinks
重新启动发动机
重写cond%{REQUEST_METHOD}^(跟踪|跟踪)
重写规则。*-[F]
重写cond%{QUERY_STRING}base64_encode.\(.*)[或]
重写条件%{QUERY\u STRING}(\\\\%3E)[NC,或]
重写条件%{QUERY\u STRING}(\\\\%3E)[NC,或]
重写条件%{QUERY\u STRING}全局(|\[|\%[0-9A-Z]{0,2})[或]
重写条件%{QUERY\u STRING}\u请求(|\[|\%[0-9A-Z]{0,2})
重写规则^(.*)$/null.php[F,L]
php_value date.timezone“亚洲/耶路撒冷”
php_值expose_php off
php_值服务器签名关闭
php_标志服务器令牌操作系统
重写cond%{REQUEST\u URI}!(\.png\.jpg\.gif\.jpeg\.bmp\.js\.css\.txt\.pdf\.zip\.doc\.docx)$
重写规则^(.*)$index.php?url=$1[NC,QSA]

我已经检查过apache中是否启用了mod_rewrite。我在我的域中尝试的所有链接都给出了404。我缺少了什么?

通过这段代码,我希望您得到的是“内部错误(500):太多内部重写”错误,而不是404错误。您的上一条规则应该排除index.php:
RewriteCond%{REQUEST_URI}!/index\.php