how to hide index.php from url on litespeed server

Viewed 353

url - example.com/index.php
want to hide /index.php
htaccess is enabled - some other rules work

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php/$1 [L]

doesn't work. index.php is still there
maybe because my server is litespeed and not apache
any help

1 Answers

Based on your shown samples, please try following.

Use either code:

RewriteEngine ON
RewriteRule ^index\.php/?$ http://%{HTTP_HOST}/ [NC,R=301]
RewriteRule ^/?$ index.php [L]

OR with THE_REQUEST variable try:

RewriteEngine ON
RewriteCond %{THE_REQUEST} \sindex\.php\s [NC]
RewriteRule ^ http://%{HTTP_HOST}/ [NC,R=301]
RewriteRule ^/?$ index.php [L]
Related