How Can We Hide Param In Url

Dear friends,

for friendly url,I am working urlManager in main.php,that is a good site to manage url,for more complate, can we hide url param ?


'urlManager'=>array(

			'urlFormat'=>'path',	

			'showScriptName' => false,

			'urlSuffix'=>'.html',					

			'rules'=>array(		 	

				'<controller:\w+>/'=>'<controller>/view',

				'<controller:\w+>/<action:\w+>/'=>'<controller>/<action>',

				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

			),

		),

for example I have url like this:


http://localhost/news/news/edit.html?id=78

I want to display my url like this:


http://localhost/news/news/edit.html

thankyou very much

If you wish to display this for single url then you can write rule for this.

And you can use iframe for this so that URL will not change through out your whole application only your content will be changed.

You may create a rule to redirect from


localhost/news/news/edit?id=78

to


localhost/news/news/edit.html

but what my question is once you redirect how you will get the id ? so that, that particular record will be edited

So what I feel that you have to create rule so that it should redirect something like


localhost/news/news/edit/78

or


localhost/news/news/78

The best you can do(so you don’t mess with the url roules) is to integrate the id into the url like this: localhost/news/news/edit-78.html

Please follow this url. Hope it is useful to you…

http://www.yiiframework.com/forum/index.php/topic/44957-problem-in-hiding-parameters-from-url/