I moved my index.php file to the root of my app. and rearranged the below two files
From this
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';
to this
require __DIR__.'/./bootstrap/autoload.php';
$app = require_once __DIR__.'/./bootstrap/start.php';
By doing the above step, this partly worked. Meaning, my website uploaded fine, the functionality worked but my CSS was out of place and my website lives within the "public" folder. In this "public" folder the website looks and works great but I don't want my website living within a folder.
My question is, how do I have my website display itself properly at the root level? and not live within the "public" folder.
Thanks
If I understood you correctly, I believe you're looking to remove the public segments from your application. Try the following steps.
Open the index.php file and change from:
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';
to:
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/start.php';
And also, open the paths.php file under the bootstrap folder, and then change from:
'public' => __DIR__.'/../public'
to:
'public' => __DIR__.'/..'
P.S. Don't forget to restart your Web server.
Try what rayeess suggested, however you should be using the public directory for your web files. Your document root in your virtual host should be set to the public folder for security reasons
T>tuyenlaptrinh said:
http://duytuyen.com/php/xoa-thu-muc-public-cua-laravel.html
May be help you
That might if it was in ENGLISH.. ;)
You can use translate of chrome or follow step by step in images
Create a new folder in the root of the project called laravel and move all files and folders into that directory EXCEPT the public folder.
Move /public files into root directory and delete the now empty public folder
Modify index.php
require __DIR__.'/../bootstrap/autoload.php';
Replace with
require __DIR__.'/laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';
Replace with
$app = require_once __DIR__.'/laravel/bootstrap/start.php';
'public' => __DIR__.'/../public',
Replace with
'public' => __DIR__.'/../..',
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community