简体   繁体   English

Live Server上的Codeigniter 404错误

[英]Codeigniter 404 Error On Live Server

i changed my controller name from controller.php to Controller.php also changed my base_url in config file to the directory where my website is hosted like www.abc.com/websitefolder but still i am getting 404 error website url : www.cyfers.com/moving/ 我将控制器名称从controller.php更改为Controller.php也将配置文件中的base_url更改为我的网站托管目录,如www.abc.com/websitefolder,但我仍然收到404错误网站网址:www.cyfers。 COM /移动/

my base_url : $config['base_url'] = 'http://www.cyfers.com/moving/'; 我的base_url: $config['base_url'] = 'http://www.cyfers.com/moving/'; : $config['base_url'] = 'http://www.cyfers.com/moving/';

my .htaccess code 我的.htaccess代码

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

在此输入图像描述

Your Base URL should be 您的基本网址应该是

$config['base_url'] = 'http://cyfers.com/moving/';

In htaccss 在htaccss

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Your Controller file should be dashboard.php . 您的Controller文件应该是dashboard.php

And default controller should be $route['default_controller'] = "dashboard"; 默认控制器应该是$route['default_controller'] = "dashboard";


To hide errors on site in root there is file call index.php 要在root中隐藏站点上的错误,可以使用文件调用index.php

Change this to 将此更改为

define('ENVIRONMENT', 'development');

this 这个

define('ENVIRONMENT', 'production');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM