By: Prem Tiwari | Last Updated:
In this tutorial, I will share how to enable pretty URLs in the Yii2 framework with the easy and simple code snippet. if you are using the basic application of the Yii2 framework, then add the following code in /config/web.php file and save it. It will remove the index.php and create an SEO friendly URLs.
if you are using the Advance application of the Yii2 framework, then open the common/config/main-local.php file and add the below code.
'components' => [
'urlManager' => [
'enablePrettyUrl' => true,
Hope this tutorial will help you! Please do like and share this tutorial with your friends and don’t forget to subscribe this blog to get the all future tutorial directly in your email box.
Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies. View all posts by Prem Tiwari