【问题标题】:Cyclical redirection at the start laravel 5 project启动 laravel 5 项目时的循环重定向
【发布时间】:2016-03-26 01:25:54
【问题描述】:

启动laravel 5 / public时的循环重定向? 我一路查了app.php / autoload.php 没关系。 在被路由之前出现。 我检查并离开清洁罗斯。 日志是空的。

serenity / public / public / public / public / public / public / public / public / public / 就是这样的计划错误。亲爱的,去哪里挖? 我添加了通过 html 运行的站点,而不是 http。 我听说有一些端口可能会被使用。

有怀疑server.php 和阿帕奇。这是代码

阿帕奇

<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]

服务器.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';

可能是什么问题?

【问题讨论】:

    标签: php apache .htaccess laravel laravel-5


    【解决方案1】:

    您的文档根目录需要指向公共目录而不是项目根目录。这样才能直接加载 index.php。对于 apache,不使用 server.php,这是在运行 artisan serve 时使用的。

    【讨论】:

      猜你喜欢
      • 2015-08-04
      • 1970-01-01
      • 1970-01-01
      • 2017-02-11
      • 2014-06-02
      • 2016-03-16
      • 2015-05-16
      • 2015-03-17
      • 1970-01-01
      相关资源
      最近更新 更多