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

6k Views Asked by At

I have recently installed centos cwp and ran to an issue with htaccess where it does not redirect correctly to the index.php file.

The code below is working offline on local host on Xampp and it actually redirect any url to index.php for the files that do not exist.

so if i have a file for estate.php and url is estate.php then it goes directly to the estate.php but if url is estate without .php then it goes to index.php however the issue with CWP is that in both cases it goes to estate.php meaning if url is estate it goes to estate.php and ignoring the 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=$1 [NC,L,QSA]

</IfModule>
1

There are 1 best solutions below

0
On BEST ANSWER

I found the solution as below: I had to add options(Multiviews) after RewriteEngine

RewriteEngine On
Options -Multiviews