Rewrite Rules

I am trying to hide the index.php and make application use index-development.php instead of index.php. Using the following rule

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^.*$ /index-development.php [NC,L]

The issue is that it also rewrites my css files and the project loads but without any style(can not find css files)

Could you please help? I have also fallowed



RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index-development.php

And set showScriptName to false in main.php config file under ‘urlManager’ sections inside components section.


I have already tried that but when writing without / before index-development the page isn’t displayed.

This line

RewriteCond %{REQUEST_FILENAME} !-f

Checks if a file exists. The rewrite will only occur if the file doesn’t exist.

You may be requesting the CSS file with the wrong URL. Disable the rewrite engine and check if you will get a 404.