Apache .htaccess重写到文件名存在但忽略扩展名的uri

Apache .htaccess重写到文件名存在但忽略扩展名的uri,apache,.htaccess,url,mod-rewrite,url-rewriting,Apache,.htaccess,Url,Mod Rewrite,Url Rewriting,我的.htaccess遇到了一个奇怪的问题,它无法将它传递到index.php。根据我当前的重写规则,如果我转到mysite.com/abc123,它会正确地重定向到index.php,并将/abc123传递到index.php要处理的查询字符串 但是,如果我转到mysite.com/test,我会看到一个apache Not Found错误页面。我希望它能转到index.php并作为查询字符串通过测试 如果我转到mysite.com/test.php,它会像预期的那样加载该文件 我的文件结构如

我的.htaccess遇到了一个奇怪的问题,它无法将它传递到index.php。根据我当前的重写规则,如果我转到mysite.com/abc123,它会正确地重定向到index.php,并将/abc123传递到index.php要处理的查询字符串

但是,如果我转到mysite.com/test,我会看到一个apache Not Found错误页面。我希望它能转到index.php并作为查询字符串通过测试

如果我转到mysite.com/test.php,它会像预期的那样加载该文件

我的文件结构如下所示:

/
|- index.php
|- test.php
|- .htaccess
这是我当前的.htaccess文件:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} /([a-z\-A-Z]+)
RewriteRule .* index.php?/$0 [L,QSA]

</IfModule>

# END WordPress

<FilesMatch "\.(html|css|js|gif|jpg|jpeg|png|ico|swf)$">
    Header set Cache-Control "max-age=259200, proxy-revalidate"
</FilesMatch>  

重新启动发动机
重写规则。*-[E=HTTP\U授权:%{HTTP:AUTHORIZATION}]
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_URI}/([a-z \-a-z]+)
重写规则。*index.php?/$0[L,QSA]
#结束WordPress
标题集缓存控制“最大年龄=259200,代理重新验证”

选项中删除
多视图

或者,如果找不到
选项
指令的位置,可以添加以下内容:

Options -MultiViews
看见