Page 1 of 1

Undefined variable: requireSSL

Posted: Fri Jul 03, 2015 7:18 pm
by kaysboutique
When loading my website - http://www.kaysboutique.co.uk,

in apache2 error logs, I can see this error constantly appearing:

Code: Select all

Undefined variable: requireSSL in /var/www/html/index.php on line 50
Code snippet for above error from index.php:

Code: Select all

// If page requires SSL, and we're not in SSL mode, 
// redirect to the SSL version of the page
if($requireSSL && $_SERVER['SERVER_PORT'] != 443) {
   header("HTTP/1.1 301 Moved Permanently");
   header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
   exit();
}
Note: I have SSL setup and working with my site.

Also, my site takes well over 2-3 minutes to load on my machine! Bonkers!

Re: Undefined variable: requireSSL

Posted: Fri Jul 03, 2015 10:33 pm
by deepvision
This code is not a part of the default OC index.php
The piece of code tries to redirect from http to https equivalents. But with undefined $requireSSL variable it never takes place. But it seems your site redirects to https pages successfully and it is probably implemented in .htaccess file.
Hence the posted code is no longer needed because it never runs anyway.

Re: Undefined variable: requireSSL

Posted: Sat Jul 04, 2015 5:01 pm
by kaysboutique
I removed the undefined variable from that line to get it working.

Re: Undefined variable: requireSSL

Posted: Sat Jul 04, 2015 5:20 pm
by deepvision
Yes, without the variable it will always redirect to https. Just what you probably need :)

Re: Undefined variable: requireSSL

Posted: Sun Jul 05, 2015 11:45 pm
by Qphoria
That is questionable code... post the line of code from your index.php file that that error points to so we can take a look at what else is going on there.