Jump to content

CCv6.05 Sitemap issue with http url


Recommended Posts

If you are on SSL, would you please take a look at the SSL tab of Store Settings. Does your store url show as http or https? I know I had big problems with Google crawling right after I changed to Forced all to SSL UNTIL I changed the store url on that tab to https://

Now on 6.0.5, it will not save the https on that tab for me.

Sure enough, my sitemaps have been pumping out http addresses. This is new to 6.0.5. I decoded the config file, changed it to https there, and saved the new encoded version back. All seems to be OK now. The sitemap now returns https url's.

You helped me make changes to my export, as well as sitemap code. So this may just be a problem for me.

Link to comment
Share on other sites

"If you are on SSL, would you please take a look at the SSL tab of Store Settings. Does your store url show as http or https?"

It shows as http -- even though I have just now finished installing a fresh 605 with a fresh database and accessed the site for the first time under https.

And, oddly, it shows as:

http://www.mydomain.com/store/setup

I did, in fact, FTP the code to a sub-folder below my main domain (so I could use the SSL certificate). It's probably a residual formulation left over from the install routines that got inserted into the config array.

The example for Store URL (which in config is known as 'standard_url') gives http, so I think it may need to stick to that -- I don't know for sure yet.

Link to comment
Share on other sites

I've gone back to CC5210 and, in SEO->sitemap(), this is the statement to at least since then:

$store_url = (CC_SSL) ? $GLOBALS['config']->get('config','standard_url') : $GLOBALS['storeURL'];

If your store is serving pages under SSL (and you will be in admin, so, yes SSL if enabled), then use the store's web address specified in the config 'standard_url', or Store Settings, SSL tab, "Store URL". If not, use what ever web address CubeCart figures out in ini.inc.php -- which probably won't be https.

So, it seems no matter what you do, CubeCart is coded to create a sitemap not using https in the web addresses.

Now, you mention you are having problems getting CubeCart to accept an https web address for "Store URL". I will test that shortly.

Link to comment
Share on other sites

In /admin/sources/settings.index.inc.php, line 103:

$config_new['standard_url'] = preg_replace('#^https://#','http://',$config_new['standard_url']);
if(substr($config_new['standard_url'],0,7) !=="http://") {
  $config_new['standard_url'] = 'http://'.$config_new['standard_url'];
}
if (!filter_var($config_new['standard_url'], FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)) {
  $config_new['standard_url'] = CC_STORE_URL;
}
// Added for backward compatibility as these old values may be used in extensions
$config_new['ssl_url'] = preg_replace('#^http://#','https://',$config_new['standard_url']);
$domain_parts = parse_url($config_new['standard_url']);
$config_new['ssl_path'] = $domain_parts['path'].'/';

So, even if you enter https, CubeCart will make sure to exchange that for http. If you don't enter https - which would get exchanged - CubeCart will prepend http for you. Finally, if the result is deemed a malformed web address (according to PHP's filter_var), then the 'standard_url' will be what CubeCart determined the web address is (in ini.inc.php) when you made the page request.

So, by "fooling" CubeCart into using the derived web address, it should stay that way until the next time you make a change to the store's config. To do this, try entering nothing in the field.

 

Link to comment
Share on other sites

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...