【问题标题】:Codeigniter Tank Auth - removing 'index.php' from config leads to endless loopCodeigniter Tank Auth - 从配置中删除“index.php”会导致无限循环
【发布时间】:2012-11-01 12:09:19
【问题描述】:

我已经从这里为 Codeigniter 安装了 Tank Auth 身份验证库的基本安装:https://github.com/ericbae/XTA2/

一切正常,直到我从我的 config.php 文件中删除 'index.php':

$config['index_page'] = '';
$config['enable_query_strings'] = FALSE;

现在我的浏览器进入无限重定向循环,并告诉我:

Firefox 检测到服务器正在重定向请求 这个地址永远不会完成。

Firebug 看起来像这样:

我的 htaccess 文件如下所示:

Options +FollowSymLinks All -Indexes

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /path/to/my/site/

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ index.php?/$1 [L]

    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule>  

这是我与许多其他 codeigniter 项目一起使用的普通 htaccess 文件,它似乎与这些项目配合得很好。

到底是什么原因造成的?

【问题讨论】:

    标签: php codeigniter tankauth


    【解决方案1】:

    变化

    $config['uri_protocol'] 成功了

    来自:

    $config['uri_protocol'] = 'PATH_INFO';

    $config['uri_protocol'] = 'REQUEST_URI';

    为我解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多