centos Web 面板 (CWP) htaccess 重定向问题 (mod_rewrite)

centos Web Panel (CWP) htaccess redirect issue (mod_rewrite)

我最近安装了 centos cwp 和 运行 htaccess 的一个问题,它没有正确重定向到 index.php 文件。

下面的代码在 Xampp 上的本地主机上脱机工作,它实际上将任何 url 重定向到 index.php 以获取不存在的文件。

所以如果我有一个 estate.php 的文件并且 url 是 estate.php 那么它直接进入 estate.php 但如果 url 是没有.php 然后它转到 index.php 但是 CWP 的问题是在这两种情况下它都会转到 estate.php 意味着如果 url 是房地产它会转到 estate.php并忽略 index.php.

<IfModule mod_rewrite.c>


RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.    RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f     
RewriteCond %{REQUEST_FILENAME} !-d     
RewriteRule ^([^?]*)$ /index.php?path= [NC,L,QSA]

</IfModule>

我找到了如下解决方案: 我必须在 RewriteEngine

之后添加选项(多视图)
RewriteEngine On
Options -Multiviews