【发布时间】:2017-03-17 19:49:33
【问题描述】:
我对 CodeIgniter 比较陌生,在学习了几个基本教程之后,我做了以下工作:
1.修改.htaccess以删除index.php页面如下:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /digischool/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>
-
修改config.php如下:
$config['base_url'] = 'localhost/testci/';
$config['index_page'] = '';
-
修改Routes.php为:
$route['default_controller'] = '仪表板';
现在对于身份验证系统,我想到了使用 Tank Auth,我所做的只是下载库,导入数据库并将所有文件复制到相应的文件夹。
现在当我尝试访问http://localhost/testci/auth/login 时, 或 /testci/dashboard/auth/login 我收到 404 not found 错误。
我试图为此搜索解决方案,但 Tank Auth 集成的文档和通信支持似乎很差。任何帮助将不胜感激。
编辑:我的Fodler结构My Folder Structure
【问题讨论】:
-
你的基本网址应该是
$config['base_url'] = 'http://localhost/testci/';而不是$config['base_url'] = 'localhost/testci/'; -
是的,我的基本网址为
<a href="/default/index/tourl?u=aHR0cDovL2xvY2FsaG9zdC90ZXN0Y2kv" rel="nofollow" target="_blank">localhost/testci</a>https 由于 SF 代码格式而丢失。我创建的所有其他控制器都工作正常,而 Tank Auth 控制器只给我 404 错误。关于命名约定,我创建了我的控制器,模型大写,但 Tank Auth 的 auth.php 是小写的。
标签: php .htaccess codeigniter mod-rewrite tankauth