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.

url

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:


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: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.