B
B
Boris Menshakov2017-09-12 12:30:26
Apache HTTP Server
Boris Menshakov, 2017-09-12 12:30:26

Where does Laravel redirect route via /public?

The root folder of the server is registered to /public

.htaccess code in /public
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

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

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

When you navigate to a url, for example site/profile , the page is displayed as it should be, and if you navigate to site/profile/ that is, with a slash at the end, then for some reason it rewrites the url to site/public/profile . I can’t find where he does it, neither in the routes nor in the controllers there is a mention of /public. Has anyone experienced this ill-fated redirect?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question