smetterd
asked on
If request on port 80, auto redirect to 443 equivalent - Moodle Course Management System
2.1 Installation of Moodle on a supported virtualmin server running Ubuntu Server 10.04 LTS
I have config file to say that the URI root should be https://mobilek16.net
When users put http://mobilek16.net, they get the error I have shown in screenshot.
I want to auto redirect them if the come in on port 80 but I can't get it to work.
I tried adding at top of index.php something like
<?php
if ($_SERVER['SERVER_PORT']<> 443) {
header('Location: https://mobilek16.net');
}
?>
But it is not working either.
Any assistance will be greatly appreciated ;-)
I have config file to say that the URI root should be https://mobilek16.net
When users put http://mobilek16.net, they get the error I have shown in screenshot.
I want to auto redirect them if the come in on port 80 but I can't get it to work.
I tried adding at top of index.php something like
<?php
if ($_SERVER['SERVER_PORT']<>
header('Location: https://mobilek16.net');
}
?>
But it is not working either.
Any assistance will be greatly appreciated ;-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Gorgeous... didn't try the second suggestion b/c the first one works!
ASKER