Php 找不到Codeigniter 3 404页面
我已将codeIgniter 3应用程序从本地上传到服务器,设置了以下文件:Php 找不到Codeigniter 3 404页面,php,codeigniter,Php,Codeigniter,我已将codeIgniter 3应用程序从本地上传到服务器,设置了以下文件: File.config $config['base_url'] = 'http://www.myswebsite.com/project'; File.routes $route['default_controller'] = 'projects'; 文件.htaccess RewriteEngine On RewriteBase /project RewriteCond %{REQUEST_URI} ^syst
File.config
$config['base_url'] = 'http://www.myswebsite.com/project';
File.routes$route['default_controller'] = 'projects';
文件.htaccess
RewriteEngine On
RewriteBase /project
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]
当我转到mainController项目时,我可以看到该页面,但在登录(该页面需要登录)后,我得到以下错误:404找不到页面
网址:www.mywebsite.come/project/login
我无法理解原因…检查控制器类名,它应该是大写字母。第一个字符应该是大写您可能需要重定向到
项目
而不是项目
控制器。我也有同样的问题,但我通过这样做克服了这个问题
为Apache 2.2或更高版本启用mod_重写。为此,请在根项目目录中创建.htaccess文件。在文件中添加下面的代码并保存
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /projectname/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
重新启动发动机
重写库/项目名/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php/$1[L]
记住其他重要的想法:
控制器文件名和类名的第一个字母必须是大写
例如:
文件名:Test.php但不是Test.php
类名:类测试扩展CI_控制器{},但不扩展类测试
仔细阅读链接,以便更好地理解:
注意:URL不能包含任何大写字母。都应该是小写字母
例如:
正确的
www.projectname.com/test/some_method
不正确
www.projectName.com/Test/someMethod
我希望你能解决这个问题。我发现了问题。登录控制器是用小写(login)而不是大写(login)编写的。