问题描述
codeIgniter版本2.2.6,我的项目在服务器上运行,而php版本7.3在本地
但是问题是,当我从c/xampp/htdocs
在本地运行项目时
通过localhost / testsite重定向到http://localhost/dashboard/
页面
这是我的.htacess
文件
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.testsite\.com$ [NC]
RewriteRule ^(.*)$ https://www.testsite.com/$1 [L,R=301]
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
这是index.php
文件
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL ^ E_NOTICE);
//error_reporting(E_ALL);
break;
case 'development':
case 'development':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
这是我的application/config/config.php
文件
if ($_SERVER['SERVER_NAME']=="localhost") {
$config['base_url'] = 'http://localhost/public_html';
$config['index_page'] = '';
}elseif ($_SERVER['SERVER_NAME']=="uat.icwdc.com") {
$config['base_url'] = 'http://uat.icwdc.com/testsite';
$config['index_page'] = '';
}else {
$config['base_url'] = 'https://www.testsite.com';
$config['index_page'] = '';
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)