I
I
Ivan Ivanov2018-06-03 11:14:59
Laravel
Ivan Ivanov, 2018-06-03 11:14:59

How to make start page a different path in Laravel?

Hello. By default, the start page in Laravel is <domain>/public . How can I make the start page just <domain>?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
pLavrenov, 2018-06-04
@pLavrenov

By default, the start page in Laravel is <domain>/public

It's not standard. So it turns out if you specify the root folder of the project in the domain config file. In the case of Laravel, you need to specify the public folder. Then the project will open correctly.
DocumentRoot /var/www/название_домена.ru/public

S
Sergey Gutovsky, 2018-06-03
@GutOf

This will only happen during the development phase.
It is possible to use localhost:8000
And for what, actually, it is necessary?

A
Alexey Maksimenko, 2018-06-03
@ddrt

Create a .htaccess file in the root of the site
Content:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question