]> git.mxchange.org Git - friendica.git/blobdiff - index.php
Merge pull request #1387 from mexon/mat/mergerequest
[friendica.git] / index.php
index d628f9ad214397acfad50f7685fb3c23d9cb202a..5dcb9a54a0da070f7e606c3c3b3862cf7a034c78 100644 (file)
--- a/index.php
+++ b/index.php
@@ -53,6 +53,13 @@ if(!$install) {
        load_config('config');
        load_config('system');
 
+       if (get_config('system','force_ssl') AND ($a->get_scheme() == "http") AND
+               (intval(get_config('system','ssl_policy')) == SSL_POLICY_FULL) AND
+               (substr($a->get_baseurl(), 0, 8) == "https://")) {
+               header("HTTP/1.1 302 Moved Temporarily");
+               header("location: ".$a->get_baseurl()."/".$a->query_string);
+       }
+
        require_once("include/session.php");
        load_hooks();
        call_hooks('init_1');