Support the ongoing development of Laravel.io →
Configuration Security Views
Last updated 2 years ago.
0

The real solution would be to point the docroot folder of your domain to the public directory. What that means is that your domain www.test.com doesn't point into the htdocs folder where your laravel lies but into the htdocs/public folder. That is a server configuration and you should be able to tell your provider to help you with that.

The public folder is a security measurement because in that way only the contents of the public folder are publically available (that's where the name stems from ;)).

When you develop locally you can achieve this with a virtual machine like the Laravel homestead.

0

OK thank you. But, the problem, I have a mutualized Hosting, I believe that we cannot configure his virtual host. It is reserved that has servers dedicated. (sorry no speak very goog Englesh);

0

i am not sure what your server structure is like.. but if it is something like this:

/user
    www < or wherever you put files to be displayed

then you can put all laravel files in /user directory, edit the line (config) to tell laravel to use www/ instead of public/..

Last updated 8 years ago.
0

What shez1983 says is true, you can configure which directory to use as the "public" directory.

But you should ask your hoster to help you with this, they will know what to do. :)

0

The other solution :

_In His Laravel project: Rename the "public" folder like this: "www."

_In An accommodation (example OVH): remove all that is at the root, including the "www" (except: .ovhconfig).

_Send His project on accommodation.

I hope it will not cause conflict. After I think we should also rename in his Laravel the "public/" in "www/".

thank You

0

Sign in to participate in this thread!

Eventy

Your banner here too?

stephweb stephweb Joined 25 Aug 2015

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.