Support the ongoing development of Laravel.io →
Authentication Requests
Last updated 2 years ago.
0

Don't upload any files other than .htaccess and index.php to your public dir?

The only directory that should really be accessible via the web is public

Last updated 2 years ago.
0

elite123 could you give the steps to achieve this?

Last updated 2 years ago.
0

@tamirh67

I guess, you don't want users to see the app, bootstrap or vendor folders.

That is the whole purpose of the public folder. You must point your browser directly to your public folder. All css and javascript goes into that folder

When you want to deploy your app, let's say you are using the domain foo.bar, you will configure your web server in order to directly serve the public folder.

Last updated 2 years ago.
0

It depends on the server configuration, but on a cpanel server, you would upload the "public" directory to "public_html" and everything else to a directory in your home directory:

/myapp
    /app
    /bootstrap
    /vendor
/public_html <- this is your "public" directory
    index.php
    .htaccess

In this scenario you have changed where the "app" directory is relative to "index.php" so you need to update the two paths in "index.php" to point to the "myapp" directory:

...
require __DIR__.'/../myapp/bootstrap/autoload.php';
...
$app = require_once __DIR__.'/../myapp/bootstrap/start.php';
...
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

tamirh67 tamirh67 Joined 24 Nov 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.