I am trying to set up laravel in a subfolder (laravel-project) of a project.
I somehow got the home page to work doing this in the config file:
rewrite "/project/home.php" /laravel-project/public/index.php$1;
However I cannot figure out how to get the routing work.
I would like that any request containing laravel-project would be redirected to laravel-project/public/index.php so that laravel can figure out which controller and which method are to be called.
I did this:
location /laravel-project {
root /home/www/virtual/mysite/laravel-project/public;
try_files $uri $uri/ /index.php?$query_string;
}
However, when I try to navigate to mysite/laravel-project or mysite/laravel-project/contacts the application never hits public/index.php file in the laravel-project folder.
Hope the information given is enough. Please let me know if any further info is required, and thank you for helping!
.env. Then you'll have to change the location for bootstrapping the app. The article explains all of this.