简体   繁体   中英

How to install correctly Laravel 5.2 on a shared / reseller hosting (hostgator)?

I have a fresh installation of Laravel 5.2.43 via ssh with composer on a reseller hosting account from Hostgator. Laravel is installed in the root like this:

 /home/user/laravel

I want to do the following: to move the public folder from Laravel internal structure, this is the url:

/home/user/laravel/public 

to another folder inside the public_html, this would be the url:

/home/user/public_html/laravel-public-folder-here

How can I do that using the right way?

To make the redirect I wanted to use the last steps from this forum post:

http://laravel.io/forum/02-13-2014-how-to-install-laravel-on-a-hostgator-shared-server

But it seems that Laravel 5.2 doesn't have the file "laravel/bootstrap/paths.php". Probably the forum post is for an older version of Laravel.

Please answer if you know how I can do that in the right way. I have looked on answers on similar questions here on stack, but they didn't solve my issue, Probably is just a Laravel config matter which I miss at the moment.

Thank you!

You only needs copy all your files of laravel project and put in folder /public_html , the next step is create an .htaccess file in /public_html with this code:

## Redirect to public folder
    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteRule ^$ public/ [L]
        RewriteRule (.*) public/$1 [L]
    </IfModule>

this work's for me in godaddy.

Regards!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM