M
M
mrWan2018-08-11 19:30:49
htaccess
mrWan, 2018-08-11 19:30:49

How to make the correct redirect to the public folder?

I do it like this:

RewriteEngine on
RewriteBase /auth-laravel/   #это у меня относительная директория, прямой путь до корня где лежит ларавел /var/www/html/auth-laravel, сайт доступен через localhost/auth-laravel/
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

something doesn't work says page not found

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2018-08-11
@v_decadence

It will be correct to direct DOCUMENT_ROOT to the public folder. Thus, these crutches will not be needed and all non-public files will be closed from outsiders.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question