5 min read

Remove index.php from URL in YII

Remove index.php from URL in YII

Last modified
1- Open root/protected/config/main.php and uncomment the UrlManager
yii_urlManager
2- Create .htaccess file and place it on the root of your site. Contents of .htaccess should be


RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php