HTTP ERROR 500 when hosting Laravel on subdomain?
<p>I followed steps on this: <a href="http://laravel.io/forum/12-29-2015-hosting-laravel-5-on-subdomain" rel="nofollow noreferrer">http://laravel.io/forum/12-29-2015-hosting-laravel-5-on-subdomain</a></p>

<p>/home->laravel-ecommerce contains all laravel files except public (see above link)</p>

<p>structure on server:</p>

<p><a href="https://i.stack.imgur.com/ovgbs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ovgbs.png" alt="enter image description here"></a></p>

<p>public_html->laravel-ecommerce contains:</p>

<p><a href="https://i.stack.imgur.com/xOzUs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xOzUs.png" alt="enter image description here"></a></p>

<p>my .htaccess looks like :</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 If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</code></pre>

<p></p>

<p>I am getting HTTP ERROR 500.</p>

<p>I don't want to move all files in public folder to main directory as it may people many be able to access other files hence security compromise. Then there is no point using laravel.</p>

<p>Is there any easier way to point the sub domain to <code>laravel-ecommerce/public</code> folder.</p>

<p>Thanks!</p>

<p><strong>Edit:</strong></p>

<p>I am hosting on hostgator. </p>

<p>Index.php:</p>

<pre><code>&lt;?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell &lt;taylor@laravel.com&gt;
 */

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/

require __DIR__.'/../../laravel-ecommerce/bootstrap/autoload.php';

/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/

$app = require_once __DIR__.'/../../laravel-ecommerce/bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$kernel = $app-&gt;make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel-&gt;handle(
    $request = Illuminate\Http\Request::capture()
);

$response-&gt;send();

$kernel-&gt;terminate($request, $response);
</code></pre>

<p>autoload.php </p>

<pre><code>&lt;?php

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Register The Composer Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/

require __DIR__.'/../laravel-ecommerce/vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| Include The Compiled Class File
|--------------------------------------------------------------------------
|
| To dramatically increase your application's performance, you may use a
| compiled class file which contains all of the classes commonly used
| by a request. The Artisan "optimize" is used to create this file.
|
*/

$compiledPath = __DIR__.'/../laravel-ecommerce/cache/compiled.php';

if (file_exists($compiledPath)) {
    require $compiledPath;
}
</code></pre>

<p>app.php</p>

<pre><code>&lt;?php

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/

$app = new Illuminate\Foundation\Application(
    realpath(__DIR__.'/../laravel-ecommerce/')
);

/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/

$app-&gt;singleton(
    Illuminate\Contracts\Http\Kernel::class,
    App\Http\Kernel::class
);

$app-&gt;singleton(
    Illuminate\Contracts\Console\Kernel::class,
    App\Console\Kernel::class
);

$app-&gt;singleton(
    Illuminate\Contracts\Debug\ExceptionHandler::class,
    App\Exceptions\Handler::class
);

/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/

return $app;
</code></pre>