简体   繁体   English

codeigniter无法在服务器上的实时页面找不到错误

[英]codeigniter not work at live page not found error on server

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. 我的codeigniter完全在本地主机上工作,但不能在live.my codeigniter工作是最新版本。我也尝试old.it总是显示我在重定向上找不到页面。

routes.php setting is routes.php设置是

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

i also upload htaccess on server.i tried in linux and window both. 我也在server.i上传htaccess在linux和window中都尝试过。

htaccess 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 并试试这个.htaccess我用于很多网站

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

if not working yet, use a phpinfo(); 如果还没有工作,请使用phpinfo(); and check if mod_rewrite is enabled 并检查是否enabled mod_rewrite

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

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