Tuesday, 10 April 2012

Yii SEO hide url parameter's name using CUrlManager

For Yii framework: SEO

For SEO, we want our url can be as short, clear, nifty as possible. but how to optimize our url which contains lots of control parameters?

If you use Yii Framwork for your project, CUrlManager is is the trick to achieve that goal!

E.g., if the url is formatted as : 


Using the following config, the request can be made as follows: 


In your PHP, you simply use $_GET['id'],$_GET['time'],$_GET['trace']....to get corresponding values! 

The trick: Pls add this rule to your main.php:

'rules'=>array('controller/action/<id>/<time>/<trace>' => 'controller/action')


  1. Bloggers, Please try this one and share your comments. "Sozialpapier" is an interest based network. It connects you to the favorite articles, authors and interests. http://sozialpapier.com .

  2. This topic is very useful for me, thanks

    web designing