title: How to setup Yii2 module on subdomain correctly?
body: <p>I have a project on Yii2 advances app. And I have created a module named 'sale' on front end, Where I have extended layouts of frontend. And now I just want to access that module as a subdomain like <code>http://sale.example.com</code> . </p>
  
  <p>I have created subdomain <code>sale.example.com</code> and set it's document root to root folder <code>public_html</code> (sites's root folder). </p>
  
  <p>I have configures my <code>urlManager</code> like <code>'http://sale.example.com' =&gt; 'sale/default/index',</code>  according to <a href="http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html#rules-with-server-names" rel="nofollow">Yii2 DOC</a>. And it working fine but all my navigation gone wrong. I mean I think app's <code>homeUrl</code> is not pointing to default site url. My entire <code>url</code> system is changed after sub domains like  <code>http://sale.example.com/contact</code>, But this is supposed to be <code>http://example.com/contact</code> .  <a href="https://www.dropbox.com/s/81zibtciackapkx/Untitled.png?dl=0" rel="nofollow">Here is a snapshot</a>.</p>
  
  <p>Thanks in Advance. </p>