Apache 将文件检测为目录

Apache 将文件检测为目录

我的文档根目录中有一个文件“result.txt”,现在当我访问时:

http://localhost/result/first

它正在访问这个:

http://localhost/result.txt/first

我的 Apache 配置中可能错误地配置了什么?

编辑:我的重写规则如下:

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
</IfModule>
<IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

答案1

他从哪里得到“.txt”?据我所知不是从重写规则得到的。

在您的 apache 配置文件中(全部)搜索“txt”字符串并禁用重写规则。

相关内容