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.