N
N
Nikita Rubinkovskiy2018-05-01 22:42:04
htaccess
Nikita Rubinkovskiy, 2018-05-01 22:42:04

How to remove public from site url?

Hello.
Periodically (or so it seems to me) when going to the main page of a site written in Laravel 5.4, there is a redirect according to the rule "mysite.ru" to "mysite.ru/public/".
How to fix the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
Troodi Larson, 2018-05-01
@troodi

You can create .htaccess at the root

RewriteEngine on
RewriteRule (.*) /public/$1 [L]

And that's it

O
O_Nayre, 2018-05-01
@O_Nayre

Make sure the .htaccess at the address public_html/public/.htaccess
matches GitHub
in short -

RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

M
matros97, 2020-03-15
@matros97

helped

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question