du4373 2018-12-13 11:36
浏览 39
已采纳

在服务器上找不到Codeigniter返回

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:

<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. Must be a problem of configuration of the server, noticed that I get not found with the server page not CodeIgniter page.

  • 写回答

1条回答 默认 最新

  • duandi1636 2018-12-13 23:49
    关注

    It might be a name declaration problem if the previous server was Windows and the new one is Linux. Windows is not case sensitive, but Linux is case sensitive.

    So Installation.php must define the class using uppercase first e.g

    class Installation extends CI_Controller {
    

    The other thing to test is that .htaccess is working - assuming you use it. If you are and this URL fails

    https://example.com/installation 
    

    But this URL works

    https://example.com/index.php/installation
    

    Then .htaccess isn't working as expected.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化