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.

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

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料