Url Manager Pass Domain Parameter

Hi everyone,


http://gtbtest1.com/projectFolder/index.php?r=site/index

URL Rules


'http://<domain:\w+>.com/<folder:\w+>/<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

I try to send a _GET parameter to my




public function actionIndex($domain)

	{

                print_r($domain);                 

		$this->render('index');

	}



But I still have:

[b]Error 400

Your request is invalid.[/b]

I tried so many permutation that I have a headache.

Now this Yii Doc: http://www.yiiframework.com/doc/guide/1.1/en/topics.url#parameterizing-hostnames

They send $user as param, I would like to do the same with the domain. How Can I do that? :)

Thank you

Dear Fryser

Correct me if I am wrong.

My conviction is that only existing GET parameters can be injected to pattern(left hand side of rule).

that can be parsed back.Can we create GET parameters from a url rule?

Moreover document on Parameterizing Hostnames says the following

The following code can serve the purpose in your case.




$host=Yii::app()->request->getHostInfo();

preg_match("/\w+\:\/\/(\w+)\.\w+/",$host,$matches);

echo $matches[1];



Gosh, I’m all confused now. :)

URL Manager only route stuff according to GET, or it also sends GET param to be use else where?