D
D
Denis Bukreev2016-07-31 15:10:13
htaccess
Denis Bukreev, 2016-07-31 15:10:13

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

2 answer(s)
S
Stanislav Pochepko, 2016-07-31
@DJZT

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>

M
Mokhirjon Naimov, 2016-07-31
@zvermafia

For NGINX: In the file , /etc/nginx/sites-available/project_name.confchange the line with the parameter rootto 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 question

Ask a Question

731 491 924 answers to any question