It is prety simple to host in sub directory.
just create new folder named "laravel" in public_html and copy all the files there.
You can navigate your project at example.com/laravel/public
If you wish to use example.com/laravel/ than you need to modify paths in bootstrap/paths.php
you have to create two folders i.e laravelApp and laravel (your sub folder) in your root directory, then follow these steps:
Copy all file and folder (except the public folder) from your app into that "laravelApp/" folder.
Copy the content of public/ folder into your laravel/ (i.e sub folder)
now edit index.php (location : Inside laravel/ folder) :
require DIR.'/../bootstrap/autoload.php'; to require DIR.'/../laravelApp/bootstrap/autoload.php'; and
$app = require_once DIR.'/../bootstrap/start.php'; to $app = require_once DIR.'/../laravelApp/bootstrap/start.php';
'public' => DIR.'/../public', to 'public' => DIR.'/../../laravel',
thats all. now you can test your application @ http://yourdomain.com/subfolder
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community