title: Sub-domain routing in Laravel on shared hosting
body: <p>I'm using Laravel framework version 5.1 for my web application that will be run on a shared hosting. Since I have a very limited access to this host, (e.g. I don't have a SSH access, can't create virtual hosts inside the machine etc.) I had to make some tricks to run it smoothly. Here is what I've done so far:</p>
  
  <ol>
  <li>Moved the files inside of the <code>public/</code> directory to my root directory.</li>
  <li>Changed the file paths of auto load registrar in the <code>public/index.php</code> with the new directory.</li>
  </ol>
  
  <p>Everything works as intended except the sub-domain routing. I defined api.myapp.com as wildcard on <code>routes.php</code> but when I try to visit this subdomain, Chrome gives me <strong>DNS_PROBE_FINISHED_NXDOMAIN</strong> error. Here is the code from <code>routes.php</code>:</p>
  
  <pre><code>Route::group([
      'domain'     =&gt; 'api.myapp.com',
      'prefix'     =&gt; 'v1',
      'middleware' =&gt; 'cors'
  ], function () {
      // some RESTful resource controllers
  });
  </code></pre>
  
  <p>How can I manage to work this subdomain? What am I missing?</p>
  
  <p>Thanks in advance!</p>