Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cib88's avatar
Level 2

Hosting my app within a website

I have a website on my server and all the files sit in public_html.

I then built a web app in laravel 5.5 and that needs to sit on the website at www.domain-name.com/laravelapp

If I've read the forum right I need to put the contents of the public in a folder located at public_html/laravelapp

then all the other files go in the directory above public_html?

I just need to know how to configure larval to look in the new location.

Any help would be great.

0 likes
1 reply
martinbean's avatar
Level 80

@craigb88 I’d upload the files outside of your public_html directory. You don’t want your app directory etc publicly-accessible.

You can still upload your public/index.php file to public_html/laravelapp, although you will need to change the paths to reference the new locations:

require __DIR__.'/../vendor/autoload.php';

should become:

require __DIR__.'/../../vendor/autoload.php';

And:

$app = require_once __DIR__.'/../bootstrap/app.php';

should become:

$app = require_once __DIR__.'/../../bootstrap/app.php';

Please or to participate in this conversation.