简体   繁体   中英

Deploy Laravel project on subfolder

I'm trying to deploy my Laravel 5.5 project on my web hosting ( PHP version 7.1.xx ). I have multiple hosting on the same server so when I connect using FTP that what I have:

-WEBSITE NUMBER 1
 -- WordPress files

-WEBSITE NUMBER 2
-- WordPress files 

-WEBSITE NUMBER 3
-- WordPress files

Now what I want is a subfolder of www.WEBSITENUMBER3.com/app/ running laravel. So I did 2 folders at the same level:

 -WEBSITE NUMBER 1
 -- WordPress files

-WEBSITE NUMBER 2
-- WordPress files 

-WEBSITE NUMBER 3
-- WordPress files
-- app 
-- laravelApp

Inside of app folder I put the files of the Public directory of Laravel, and in the laravelApp folder I put all my laravel project ( except public folder ) Now the problem is that when I visit www.WEBSITENUMBER3.com/app/ all the links are broken, bootstrap doesn't get load because he tries to load :

www.WEBSITENUMBER3.com/bootstrap

instead of www.WEBSITENUMBER3.com/app/bootstrap

so all the things of my Application. So is there a way to change the root where laravel works? I found impossible and wrong change all links in Laravel manually to make them absolutely I want to keep them relative.

You should set the right path four your app in the .env file, in the root folder.

The APP_URL line should be set like this:

APP_URL=www.WEBSITENUMBER3.com/app/

After changing the .env , you need to restart the webserver. The additional steps depend on your webserver.

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