[英]Codeigniter return not found on the server
I just uploaded my application into another server (worked well on the previous), but now I get this error: 我刚刚将我的应用程序上传到另一台服务器上(在先前的服务器上运行良好),但是现在出现此错误:
Not Found
The requested URL /lk/installation was not found on this server.
I suspect that there are some issues with the .htaccess
which have the following content: 我怀疑.htaccess
存在一些问题,这些问题具有以下内容:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
the controller installation
is declared as: Installation.php
, but I repeat, the application worked well on the previous server so there aren't technical problem like class name declaration or something like. 控制器的installation
声明为: Installation.php
,但我重复一遍,该应用程序在先前的服务器上运行良好,因此没有诸如类名声明之类的技术问题。 Must be a problem of configuration of the server, noticed that I get not found with the server page not CodeIgniter page. 必须是服务器的配置问题,注意我找不到服务器页面而不是CodeIgniter页面。
It might be a name declaration problem if the previous server was Windows and the new one is Linux. 如果以前的服务器是Windows,而新的服务器是Linux,则可能是名称声明问题。 Windows is not case sensitive, but Linux is case sensitive. 的Windows 不区分大小写,但Linux 是区分大小写。
So Installation.php
must define the class using uppercase first eg 因此, Installation.php
必须首先使用大写字母定义类,例如
class Installation extends CI_Controller {
The other thing to test is that .htaccess is working - assuming you use it. 要测试的另一件事是.htaccess是否正常工作-假设您使用它。 If you are and this URL fails 如果您是这个网址失败
https://example.com/installation
But this URL works 但是这个URL有效
https://example.com/index.php/installation
Then .htaccess isn't working as expected. 然后,.htaccess无法正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.