Why codeIgniter show the requested URL was not found on this server?

前端 未结 3 1803
野性不改
野性不改 2020-12-21 04:58

I want to ask. First of all, I will tell that I\'ve develop an application use codeIgniter on my windows dekstop. And it clear and run completely.

But, after I move

相关标签:
3条回答
  • 2020-12-21 05:35

    First of all enable mod_rewrite then restart apache2 using following commands:

    sudo a2enmod rewrite
    sudo service apache2 restart
    

    then open apache conf file using command:

    sudo gedit /etc/apache2/apache2.conf
    

    uncomment below line if it is commented

    AccessFileName .htaccess
    

    then find these lines in apache2.conf

    <Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
    

    here change the line AllowOverride None to AllowOverride All and save this file.

    Now, your issue is resolved.

    0 讨论(0)
  • 2020-12-21 05:38

    First thing that you should know the debian is a Linux base server. So Its not like windows servers(XAMPP and WAMP).

    So first of all consider about Letters. It means debian Sever is Case-Sensitive.

    So check your naming conversation as well

    Check these

    1. Controller class name class Admin extends CI_Controller
    2. Controller file name should be admin.php
    3. Check in routes.php. In routes $route['default_controller'] = "admin";
    0 讨论(0)
  • 2020-12-21 05:40

    Codelgniter URL example :

    example.com/class/function/id/ 
    

    So check your class name correct or not, And call url instead of Capital A - Admin to admin.

    <?php (defined('BASEPATH')) OR exit('No direct script access allowed');
    
    class Admin extends CI_Controller 
    {
    
    }  
    

    Note: if you use codelgniter-3 version file name also must Should capital A. I mean Admin.php

    0 讨论(0)
提交回复
热议问题