1

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.

Ivanka Todorova
  • 9,964
  • 16
  • 66
  • 103
Naren
  • 105
  • 2
  • 10

1 Answers1

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
  • 158,981
  • 26
  • 290
  • 279
  • Do you mean when uploading online? Is it the safe way? DocumentRoot "/http://domain.com/public" – Naren Oct 31 '16 at 08:23