Error when Hide index.php on server

Hi! I am using Yii and currently i am trying to hide the index.php from my URL. I have hosted my project on server. The contents of my .htaccess file are

<ifModule mod_rewrite.c>

Options -Multiviews

Options +FollowSymLinks

Turn on the engine:

RewriteEngine on

Don’t perform redirects for files and directories that exist:

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

For everything else, redirect to index.php:

RewriteRule . index.php


and in the config/main.php showScriptName=>False

I searched about it a lot and found that adding Options -Multiviews solves the problem. But it didnt work for me. It shows 404 - File or directory not found.

So any help will be appreciated

Can you share your urlManager configuration?

First, check if the module is present, else, you can’t do anything with your urls.