In my Laravel 5.2 project, I would like to remove the "public" from URL. I found several ways to achieve this, but I am concerned with the safest way to do it. Please note that I place all my uploaded images / files (Word/PDF) in the public/ holder. For example, I store them to public/uploads/myimages/images.jpg and public/uploads/myfiles/files.pdf/.doc and so forth.
Asked
Active
Viewed 60 times
1
Ivanka Todorova
- 9,533
- 15
- 56
- 97
Naren
- 105
- 1
- 10
1 Answers
0
To remove public from URL you should set this directory as document root in web server configuration. Apache directives, for example:
DocumentRoot "/path_to_laravel_project/public"
<Directory "/path_to_laravel_project/public">
Community
- 1
- 1
Alexey Mezenin
- 148,626
- 22
- 267
- 261
-
Do you mean when uploading online? Is it the safe way? DocumentRoot "/http://domain.com/public"
– Naren Oct 31 '16 at 08:23