2

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

RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93
qadenza
  • 9,025
  • 18
  • 73
  • 126

1 Answers1

2

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]
RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93