Quantcast
Channel: Installing and upgrading help
Viewing all articles
Browse latest Browse all 46788

https getting redirected and not working

$
0
0
by Vijay N.  

Hi,

Moodle 2.5.1

LAMP environment

I am having trouble setting up https access for my site. The https setup has been set on the apache server. I have 2 sites running on the same server

Site 1: config.php

<?php // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'aaaa';
$CFG->dbuser = 'aaaa';
$CFG->dbpass = 'aaaa';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbsocket' => 0,
);

$CFG->wwwroot = 'https://site1.xxxx.com';
$CFG->dirroot = '/var/www/html/moodle.site1';
$CFG->dataroot = '/opt/moodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 0777;

$CFG->passwordsaltmain = .......;

require_once(dirname(__FILE__) . '/lib/setup.php');

// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!
?>

Site 2: this site runs on Moodle 1.9 and was initially put in place before site 1 was added to the server

<?php // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'aaaa';
$CFG->dbuser = 'aaaa';
$CFG->dbpass = 'aaaa';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbsocket' => 0,
);

$CFG->wwwroot = 'https://site2.xxxx.com';
$CFG->dirroot = '/var/www/html/moodle.site2';
$CFG->dataroot = '/opt/moodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 0777;

$CFG->passwordsaltmain = .......;

require_once(dirname(__FILE__) . '/lib/setup.php');

// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!
?>

 

The problem occuring is that the site https://site1.xxxx.com gets redirected to https://site2.xxxx.com

If I changes the url from https to http for site 1 then it works. it is only when I change to https  that it gets redirected to the site 2. Our server hosting provide says that they ran a curl command which showed it returned a 200 OK 

Any ideas why this redirect is happening even though there are no redirect rules setup on the webserver?

Thanks in advance

vijay


Viewing all articles
Browse latest Browse all 46788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>