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.

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

报告相同问题?