M
M
Mykola Ivashchuk2018-04-22 17:09:36
htaccess
Mykola Ivashchuk, 2018-04-22 17:09:36

How to redirect user to public?

The framework is in the
public_html/laravel directory
Accordingly, now access to the site is like this:
site.com/laravel/public
You need to remove pubilc from the path using only htaccess

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Fedorov, 2018-04-22
@Maksclub

all your ways to do it are crutches, there is one right way - to do it right:
1. Place all the framework files NEAR the /public_html folder
2. Copy the contents of the /public folder to the /public_html folder
3. In this folder, place . htaccess with a simple setup:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

4. Since we changed public to public_html, we need to change something:
https://stackoverflow.com/questions/30198669/how-t...

Y
Yan-s, 2018-04-22
@Yan-s

https://stackoverflow.com/questions/23837933/how-c...

M
Mysterion, 2018-04-22
@Mysterion

<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