Jump to content

[Resolved] download link on https


jpayam

Recommended Posts

Hello,

 

I install ssl om my site and it works fine only my problem is  download links not works any more when customer click on download link

http://mydomain.com/index.php?_a=download&accesskey=177debdf27b46d6967035cc8b1ffbe11

and link will redirect to :

https://mydomain.comindex.php/?_a=download&accesskey=177debdf27b46d6967035cc8b1ffbe11

 

but if i change http://mydomain.com/index.php?_a=download&accesskey=177debdf27b46d6967035cc8b1ffbe11  to httpS://mydomain.com/index.php?_a=download&accesskey=177debdf27b46d6967035cc8b1ffbe11  then link works fine

p.s : i use digit file on external url

 

thanks in advance for help

 

 

 

 

 

Link to comment
Share on other sites

1 hour ago, bsmither said:

When you installed the SSL, did you also add or change any information to CubeCart's .htaccess file?

 

No, but i just add this code to .htaccess file and problem has been fixed as Download links on emails and customers control panel has been changed to HTTPs automatically!

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

still we when  click on  http://mydomain.com/index.php?_a=download&accesskey=177debdf27b46d6967035cc8b1ffbe11  redirect to wrong url :  https://mydomain.comindex.php/?_a=download&accesskey=177debdf27b46d6967035cc8b1ffbe11

Link to comment
Share on other sites

Please find the file in your CubeCart installation /includes/global.inc.php, and look at its contents.

Is this variable listed?
$glob['rootRel']

If so, this variable and maybe some others are not needed by CC6.

If not, then we need to look elsewhere.

Link to comment
Share on other sites

$glob['rootRel']  is not listed, my  /includes/global.inc.php contents:

<?php
$glob['adminFile'] = 'admin.php';
$glob['adminFolder'] = 'admin';
$glob['dbdatabase'] = 'X';
$glob['dbhost'] = 'localhost';
$glob['dbpassword'] = 'X';
$glob['dbprefix'] = '';
$glob['dbusername'] = 'X';
$glob['encoder'] = 'zend';
$glob['installed'] = '1';
$glob['license_key'] = '';
$glob['cache'] = 'file';
?>

 

Link to comment
Share on other sites

The problem in the code will affect more than just downloads. See: https://github.com/cubecart/v6/issues/1203

I will make a suggested edit, but I have no idea what else this will affect. Initial tests show no anomalous actions. I can't speak for any of the myriad of plugins, however.

In the file /controllers/controller.index.inc.php:

Using a programmer's text editor...

Find near line 43:

//Initialize SEO
/**/ $GLOBALS['ssl'] = SSL::getInstance(); $GLOBALS['seo'] = SEO::getInstance();

Change to:

//Initialize SSL and SEO
$GLOBALS['ssl'] = SSL::getInstance(); $GLOBALS['seo'] = SEO::getInstance();

Find near line 49:

//Initialize SSL
$GLOBALS['ssl'] = SSL::getInstance();

Change to:

//Initialize SSL
//$GLOBALS['ssl'] = SSL::getInstance();

This switches the order of re-configuring the URL to be search engine friendly, and re-configuring the URL to be SSL if the store has SSL enabled.

The actual problem with the code does not get fixed, however. What this edit does is to pre-configure the URL so that the problem code can let it slip through unharmed.

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...