我对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'] ='';
Modifed Routes.php为:
$ route ['default_controller'] ='仪表板';
现在对于认证系统,我想到了使用Tank Auth,并且我所做的都是下载库,导入数据库并将所有文件复制到各自的文件夹。
现在,当我尝试访问http:// localhost / testci / auth / login或/ testci / dashboard / auth / login时,我得到404未找到错误。
我试图为此搜索解决方案,但文档和通信支持似乎对Tank Auth集成很差。 任何帮助将不胜感激。
编辑:我的Fodler结构我的文件夹结构
I'm relatively new to CodeIgniter and after going through couple of basic tutorials, here is what i did:
1.Modified .htaccess to removed index.php page as below:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /digischool/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [QSA,L] </IfModule>Modified config.php as below:
$config['base_url'] = 'localhost/testci/';
$config['index_page'] = '';
Modifed Routes.php as :
$route['default_controller'] = 'dashboard';
Now for authentication system I thought of using Tank Auth,and all I have did is downloaded the library, imported database and copied all files to respective folder.
Now when I am trying to access http://localhost/testci/auth/login, or /testci/dashboard/auth/login I'm getting 404 not found error.
I tried to search solution for this,but documentation and communicty support seems to be poor for Tank Auth integration. Any help will be highly appreciated.
Edit: My Fodler Structure My Folder Structure
最满意答案
最后的解决方案和解决问题。 在此发布解决方案以供将来使用:
根据CI用户指南命名约定,
类文件必须以类似Ucfirst的方式命名,而任何其他文件名(配置,视图,通用脚本等)都应该全部小写。
但是Tank Auth使用小写的控制器和模型类名称。 所以不得不将Tank Auth控制器和模型文件重命名为大写字母,并根据哪些参考值对我进行更改。
感谢@ wolfgang1983获取用户指南命名约定的链接,这有助于我解决问题。
At last solution and fixed issue. Posting solution here for future use:
As per CI user guide naming convention,
Class files must be named in a Ucfirst-like manner, while any other file name (configurations, views, generic scripts, etc.) should be in all lowercase.
But Tank Auth uses controller and model class names in lower case. So had to rename Tank Auth controller and model files to upper case and change the references according which worked for me.
Thanks @wolfgang1983 for your link to user guide naming convention which helped me in fixing the issue.
更多推荐
发布评论