Php codeigniter无法在live页面上工作服务器上未找到错误
我的codeigniter可以在本地主机上完美工作,但不能在live上工作。我的codeigniter是最新版本。我还尝试了更旧的版本。它总是显示重定向上找不到的页面 routes.php设置为Php codeigniter无法在live页面上工作服务器上未找到错误,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,我的codeigniter可以在本地主机上完美工作,但不能在live上工作。我的codeigniter是最新版本。我还尝试了更旧的版本。它总是显示重定向上找不到的页面 routes.php设置为 $route['default_controller'] = "home"; $route['404_override'] = ''; 我还将htaccess上传到服务器上。我在linux和Windows中都尝试过 htaccess RewriteEngine on RewriteCond $1 !^
$route['default_controller'] = "home";
$route['404_override'] = '';
我还将htaccess上传到服务器上。我在linux和Windows中都尝试过
htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
你可以做:
$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
试试这个.htaccess
我在很多网站上都用过
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
如果尚未工作,请使用
phpinfo()
并检查mod_rewrite是否启用了
您的本地和远程htaccess线路如何RewriteBase/
?是的,请在我的问题中发布您的.htaccess
.htaccess更新。请检查此您用于访问网站的URL是什么,网站安装在哪个目录中。Codeigniter不需要htaccess,请尝试完全删除它。另请参见:您的config.php URL设置是什么?您确定在live you应用程序上是根域文件夹,而不是子目录中吗?