title: Laravel subdomain 500 error
body: <p>We are running on shared hosting and running laravel on main domain that is <code>example.com</code> , everything is working perfectly fine.</p>
  
  <p>We have crated a sudbomain <code>test.example.com</code>  by vising <em>Subdomains manager</em> in <em>cPanel</em> and pointed it's document root to <code>/public_html/test</code></p>
  
  <p>As soon as we visit <code>test.example.com</code> we get <strong>500 Internal Server Error</strong></p>
  
  <p>Initial laravel's .htaccess is </p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      &lt;IfModule mod_negotiation.c&gt;
          Options -MultiViews
      &lt;/IfModule&gt;
  
      RewriteEngine On
  
      # Redirect Trailing Slashes...
      RewriteRule ^(.*)/$ /$1 [L,R=301]
  
      # Handle Front Controller...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^ index.php [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>We have changed.</p>
  
  <pre><code>    RewriteRule ^ index.php [L]
  </code></pre>
  
  <p>to</p>
  
  <pre><code>    RewriteRule ^ /index.php [L]
  </code></pre>
  
  <p>Now if we visit <code>test.example.com</code> it redirect to <code>tests.example.com/test</code> and everything works normally.</p>
  
  <p>But we not sure why it is redirecting browser to <code>tests.example.com/test</code> ?</p>
  
  <p><strong>Updated</strong></p>
  
  <p>After further research we found that.</p>
  
  <p>If we remove this line.</p>
  
  <pre><code>RewriteRule ^(.*)/$ /$1 [L,R=301]
  </code></pre>
  
  <p>Then both maindomain and subdomain working perfectly fine. But is it OK to remove this line.</p>
  
  <p>In short we want to run laravel on main domain and something else on subdomain.</p>