Answer the question
In order to leave comments, you need to log in
How to make redirect to public in Laravel?
So it goes.
In Laravel, the root of the site is the public folder.
But the servers do not know this and, when requesting a site, they give the project root.
How to set up public opening with address saving?
Answer the question
In order to leave comments, you need to log in
In fact, it is correct to specify root in the public folder.
And so here's your .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
For NGINX: In the file , /etc/nginx/sites-available/project_name.conf
change the line with the parameter root
to root /path/to/project/public
, then sudo service nginx restart
UPD: project_name is the name of the project or the domain name of the project :) (awesome_project.conf, example.com.conf, ...)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question