Url Manager Configuration in Yii framework

To change the URL format, we should configure the urlManager application component so that createUrl can automatically switch to the new format and the application can properly understand the new URLs. The complete URL management in yii framework for a Web application involves two aspects:

  1. When a user request comes in terms of a URL, the application needs to parse it into understandable parameters.
  2. The application needs to provide a way of creating URLs so that the created URLs can be understood by the application.


For a Yii application, these are accomplished with the help of CUrlManager.

To Hide index.php for SEO purpose

Go the root folder => protected => config => main.php

Open the main.php and replace the current code with :

Add following source codes in .htaccess

Note:Dont change .htaccess file inside protected
Note:Create .htaccess file outside protectd folder

Include .html after the page

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:

Article Tags: ,