I found the solution to this issue from a thread on the forums. It means making a correction to the tep_redirect function in functions/general.php.

You need to add the DIR_WS_HTTPS_CATALOG constant into the url transformation part…

Before:

// Redirect to another page or site
function tep_redirect($url) {
$url = str_replace(‘&’, ‘&’, $url); //Ampersand fix
if ( (strstr($url, “\n”) != false) || (strstr($url, “\r”) != false) ) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, ”, ‘NONSSL’, false));
}

if ( (ENABLE_SSL == true) && (getenv(‘HTTPS’) == ‘on’) ) { // We are loading an SSL page
if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url
$url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER)); // Change it to SSL
}
}

header(‘Location: ‘ . $url);

tep_exit();
}

After:

// Redirect to another page or site
function tep_redirect($url) {
$url = str_replace(‘&’, ‘&’, $url); //Ampersand fix
if ( (strstr($url, “\n”) != false) || (strstr($url, “\r”) != false) ) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, ”, ‘NONSSL’, false));
}

if ( (ENABLE_SSL == true) && (getenv(‘HTTPS’) == ‘on’) ) { // We are loading an SSL page
if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url
$url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL
}
}

header(‘Location: ‘ . $url);

tep_exit();
}

Note: I have modified the function from standard already to provide xhtml compliant pages. You can strip the ‘//Ampersand fix’ line.

Categories: osCommercePHP

Jonathan Adjei

Jon's expertise in web development is legendary and he oversees all technical aspects of our projects from development to hosting (all through the command line!) Jon is excited by the latest techniques and keeps the company on track by finding ways to adopt new practices into our workflow.