Routes Including Host Part

Hi guys.

I’m trying to deal with routes that include host part.

Here’s what I found:

$request->getHostInfo() at UrlRule::parseRequest() (line 201) returns http://example.com, but $this->pattern (a couple of lines lower) equals to #^example.com$#u so preg_match() fails.

There are no routing docs yet, so I suppose I can have missed something.

Here’s my test route:


array(

    'host' => 'example.com',

    'pattern' => '',

    'route' => 'mycontroller/index',

),

I believe Yii Guide has section for routing with hostname check the guide under Url Managment

No.

I am not sure if this is what you need but here is link knock yourself out

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

I’m talking about Yii2. In Yii1 everything works fine.

Dude you did not mention Yii2 only now

See subforum name.