Cyclical redirection at the start laravel 5 project

- 1 answer

Ad

Cyclical redirection when you start laravel 5 / public? I checked all the way app.php / autoload.php It's all right. Appears before being routed. I checked and left cleaned Roth. The logs are empty.

serenity / public / public / public / public / public / public / public / public / public / That such a plan error. Where to dig, dear? I add that site running through htpps, not http. I've heard there is some ports may be employed.

There are suspected server.php And Apache. Here is the code

Apach

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

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

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

Server.php

    <?php

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
    return false;
}

require_once __DIR__.'/public/index.php';

What could be the problem?

Ad

Answer

Ad

Your document root needs to point to the public directory not the project root directory. This is so that index.php is loaded directly. For apache, server.php is not used, that is for when you run artisan serve.

Ad
source: stackoverflow.com
Ad