how to use the httpdocs folder of the hosting as public of laravel?

0

I have a problem with my plesk hosting, I have my project finished in laravel 5.1 and locally everything works fine, I make product registrations and upload the files. the detail is when I upload my page to the plesk hosting, and the public folder does not manage it, instead the folder httpdocs, then I passed all public files to httpdocs and the rest of the site is in another folder but within httpdocs and that if I leave it out it does not allow me to obtain the files. This way I configure the index.php so that it points me to the files of bootstrap, it loads the page to me well but at the moment of realizing the registries of products it does not save the images to me, only the information keeps me to the database. note: when uploading the files I save the images in public / images and in the database it saves the name of the image.

I use this function in the model ..............

public function setPathAttribute($path){
    if (!empty($path)) {
        $this->attributes['path']=Carbon::now()>second.$path>getClientOriginalName();   
        $name=Carbon::now()>second.$path>getClientOriginalName();
        \Storage::disk('local')->put($name, \File::get($path));
        }
    }
.......filesystems......

        'local' => [
            'driver' => 'local',
            'root'   => public_path('images'),
             ],

I hope you will help me for 3 days without being able to resolve

    
asked by TecnoPC DColor 04.07.2018 в 16:32
source

1 answer

0

You can simply pass your entire project to httpdocs and at the root of the project redirect all requests to public with a .htaccess

<IfModule mod_rewrite.c>
    RewriteBase / #En algunos hosting debes reescribir la base, elimina la linea si no es necesaria

    RewriteEngine On
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

If this does not work for you I have a much longer but effective equal.

RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www.)?miDomino.com$
RewriteCond %{REQUEST_URI} !^/public/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /public/$1

RewriteCond %{HTTP_HOST} ^(www.)?miDomino.com$
RewriteRule ^(/)?$ public/index.php [L] 

Options -Indexes
    
answered by 04.07.2018 в 17:34