How to Enable Pretty urls in Yii2 Framework

By: Prem Tiwari | Last Updated: | In: Code Snippets


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.


About: Prem Tiwari

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.


Tags: , , , , ,