CI modules working on local, but giving 404 not fo

2019-08-27 01:52发布

问题:

I am working on Codeigniter HMVC & getting an problem that when i execute http://localhost/school_erp/administrator on local it is working fine, but when i access same url on http://mydomain/admnistrator, the it is giving 404 not found.

This line is define in constant define('ADMIN_LOGIN_PATH', 'administrator');

My routes :

$route['default_controller']                           = "login/admin";

$route['page/(:any)']                                  = 'page/page/admin/$1';

$route['404_override']                                 = 'error/page/e404';

$route['404']                                          = 'error/page/e404';

$route[ADMIN_LOGIN_PATH]                               = 'login/admin';

$route[ADMIN_LOGIN_PATH.'/([a-zA-Z_-]+)/(:any)']       =  '$1/admin/$2';

Plz help..

回答1:

Make sure that

.htaccess file should be outside the application folder with proper configuration.

The first letter of Controller name should be capital. eg Login not login.



回答2:

Make sure your database table name case on your remote server is the same as in your code

Because: "Triggers also correspond to files. Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database, table, and trigger names. This means such names are not case sensitive in Windows, but are case sensitive in most varieties of Unix "

https://dev.mysql.com/doc/refman/5.7/en/identifier-case-sensitivity.html