Post by kaysboutique » Fri Jul 03, 2015 7:18 pm

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!

Newbie

Posts

Joined
Fri Jul 03, 2015 7:16 pm

Post by deepvision » Fri Jul 03, 2015 10:33 pm

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.

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am

Post by kaysboutique » Sat Jul 04, 2015 5:01 pm

I removed the undefined variable from that line to get it working.

Newbie

Posts

Joined
Fri Jul 03, 2015 7:16 pm

Post by deepvision » Sat Jul 04, 2015 5:20 pm

Yes, without the variable it will always redirect to https. Just what you probably need :)

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am

Post by Qphoria » Sun Jul 05, 2015 11:45 pm

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.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 3 guests