Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将域从http更改为https Zend framework_Php_Codeigniter_Ssl_Zend Framework_Https - Fatal编程技术网

Php 将域从http更改为https Zend framework

Php 将域从http更改为https Zend framework,php,codeigniter,ssl,zend-framework,https,Php,Codeigniter,Ssl,Zend Framework,Https,我正在尝试从http切换到https,该应用程序正在使用zend框架。ssl证书已经安装,一切都准备就绪,在config.php文件中,我更改了源代码 $config['base_url'] = 'http://example.com/'; 对此 $config['base_url'] = 'https://example.com/'; 但是,当我刚刚进入主页时,所有内容都正确加载,当我单击其他链接(example.com/player或example.com/main)时,除了主页之外的任

我正在尝试从http切换到https,该应用程序正在使用zend框架。ssl证书已经安装,一切都准备就绪,在config.php文件中,我更改了源代码

$config['base_url'] = 'http://example.com/';
对此

$config['base_url'] = 'https://example.com/';
但是,当我刚刚进入主页时,所有内容都正确加载,当我单击其他链接(example.com/player或example.com/main)时,除了主页之外的任何链接都会抛出404错误

$config['base_url'] = 'https://example.com/';


通过.htaccess fileZend或CodeIgniter重定向它?@Raza Khan GZap:检查这个我尝试了你给我的代码,但没有成功。当我导航到其他视图(如)时,它抛出一个404错误。但是在routes文件中,当我将主页更改为另一个页面时,它将只在主域站点example.com上提供服务。
$config['base_url'] = (isset($_SERVER['HTTPS']) ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . preg_replace('@/+$@', '', dirname($_SERVER['SCRIPT_NAME'])) . '/';

$config['base_path'] = $_SERVER['DOCUMENT_ROOT'] . preg_replace('@/+$@', '', dirname($_SERVER['SCRIPT_NAME'])) . '/';