How to Enable Pretty urls in Yii2 Framework

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.

yii2-600

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.

How to Enable Pretty urls in Yii2 Framework

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.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , , ,