How to remove index.php and ?r= in Yii Framework

Hi guys in this article you are going to see “How to remove index.php and ?r= in Yii Framework”

we have already seen how to download and Install Yii Framework in earlier tutorials

Do these 3 steps:

Enable Url re-writing on Apache.
Place .htaccess on root of your project


RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php



In your configuration protected/config/main.php set showScriptName to false like this to your url manager components >> urlManager




Add a Comment

Your email address will not be published. Required fields are marked *