使用Tank Auth配置Codeigniter

时间:2012-02-04 01:09:22

标签: codeigniter tankauth

我的CI配置中的某些内容缺少Tank auth视图文件所期望的“/”,我无法弄明白。我希望你能!

以下是一些细节: $config['base_url'] = 'http://localhost/CI/';

我没有.htaccess设置(所以我的URI中仍然有index.php)

当Tank auth加载其中一个视图文件时,这是第一行: <?php echo form_open($this->uri->uri_string()); ?>

生成的URI无法加载,因为它显示为“http://localhost/CI/index.php?auth/register而不是http://localhost/CI/index.php/auth/register

但是,如果我将其修改为: <?php echo form_open("/".$this->uri->uri_string()); ?> 一切都很好。但现在这就是它的工作方式!我错过了什么?

谢谢!

1 个答案:

答案 0 :(得分:1)

为什么不使用.htaccess删除index.php?这样可以解决问题并为您提供更清晰的URL。

这里没有用于我在本地主机上安装Tank Auth的重写。

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

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /~Steve/_sandbox/tank_auth/index.php/$1 [L]

ErrorDocument 404 /index.php
相关问题