在现场找不到网页错误服务器上codeigniter无法正常工作 [英] codeigniter not work at live page not found error on server

查看:185
本文介绍了在现场找不到网页错误服务器上codeigniter无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的codeigniter工作完全本地主机上,但不工作live.my codeigniter的最新version.i也尽量older.it总是告诉我网页重定向没有找到。

routes.php文件设置为

  $航线['default_controller'] =家;
$路线['404_override'] ='';
 

我也上传到server.i htaccess的尝试Linux和窗口两种。

的htaccess

  RewriteEngine叙述上
的RewriteCond $ l ^(指数\ .PHP |资源|机器人\ .TXT)!
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^(。*)$的index.php?/ $ 1 [L,QSA]
 

解决方案

你可以这样做:

  $配置['BASE_URL'] ='HTTP://'.$_SERVER ['HTTP_HOST']; //你也可以离开这个CI倾向于自己找到了这个空白
$配置['index_page'] ='';

$配置['uri_protocol'] ='自动'; //如果不工作尝试下列操作之一:
     'PATH_INFO'使用PATH_INFO
    | 'QUERY_STRING'使用QUERY_STRING
    | REQUEST_URI采用REQUEST_URI
    | ORIG_PATH_INFO采用ORIG_PATH_INFO
 

和尝试这个的.htaccess 我用很多网站

  RewriteEngine叙述上
的RewriteBase /
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^(。*)$ /index.php/$1 [L]
 

如果还没有成型,使用的phpinfo(); 并检查mod_rewrite的是启用

my codeigniter work perfectly on local host but not work at live.my codeigniter is latest version.i also try older.it always show me page not found on redirect.

routes.php setting is

$route['default_controller'] = "home";
$route['404_override'] = '';

i also upload htaccess on server.i tried in linux and window both.

htaccess

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

解决方案

you can do:

$config['base_url'] = 'http://'.$_SERVER['HTTP_HOST']; //you can also leave blank this CI tend to find this by himself
$config['index_page'] = '';

$config['uri_protocol'] = 'AUTO'; //if not working try one of these:
     'PATH_INFO'        Uses the PATH_INFO
    | 'QUERY_STRING'    Uses the QUERY_STRING
    | 'REQUEST_URI'     Uses the REQUEST_URI
    | 'ORIG_PATH_INFO'  Uses the ORIG_PATH_INFO

and try this .htaccess i use for many sites

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

if not working yet, use a phpinfo(); and check if mod_rewrite is enabled

这篇关于在现场找不到网页错误服务器上codeigniter无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆