How to Remove index.php in the url of Yii Website?

Usually, when we run a Yii website, the URL will have index.php after the hostname. To remove this in appache web server, we need to enable the mode_rewrite module and should create .htaccess file.

To hide index.php from the url on a website, add an .htaccess file to your web root, with this text:


After adding .htaccess, go to /protected/config/ directory open main.php file add 'showScriptName'=>false to urlManager Array


That’s it you’re Done!

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 vote
Article Rating
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Ram Choubey
Ram Choubey
6 years ago
DMCA.com Protection Status
2
0
Would love your thoughts, please comment.x
()
x