Url Manager Configuration in Yii framework

| Last Updated: | 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

Tags: ,


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:

Follow us!

Get Free Access of 400+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Free Guide: Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...

SEARCH NOW