Post by Josetxu » Sun Mar 06, 2016 2:42 am

Hi,

I need some help.

In my installation I OC2.1 SSL is enabled on the product page, Why can this happen? Should only enable SSL in checkout, and login ...
But not always SSL is activated. Examples:

SSL is not activated when I go to the product page from the serch field, or from latest, special, featured or other module.
SSL is activated when I go to the product page from a category or subcategory.

That can happen?

Regards

Newbie

Posts

Joined
Thu Dec 29, 2011 6:07 am

Post by EvolveWebHosting » Sun Mar 06, 2016 7:23 am

Check your config files and make sure you only added the 's' in the HTTPS section of each config file.

2 Week FREE Trial of our Shared Hosting plans (DIrectAdmin or cPanel) for new customers
2 Week FREE Trial of Astra Firewall and Malware Scanner
Visit our website for full details and to start your trial today - www.evolvewebhost.com


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA

Post by Josetxu » Sun Mar 06, 2016 8:21 am

Hi,
The configuration files are correct. only "S" in https.

Newbie

Posts

Joined
Thu Dec 29, 2011 6:07 am

Post by EvolveWebHosting » Sun Mar 06, 2016 8:28 am

Josetxu wrote:Hi,
The configuration files are correct. only "S" in https.
What is in your .htaccess file?

2 Week FREE Trial of our Shared Hosting plans (DIrectAdmin or cPanel) for new customers
2 Week FREE Trial of Astra Firewall and Malware Scanner
Visit our website for full details and to start your trial today - www.evolvewebhost.com


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA

Post by Josetxu » Sun Mar 06, 2016 8:46 am

This is my .htaccess file, but I tried also with the default.

Code: Select all

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

<IfModule mod_expires.c>
  ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
  ExpiresDefault "access plus 1 month"

# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
  ExpiresByType text/cache-manifest "access plus 0 seconds"

# Your document html
  ExpiresByType text/html "access plus 0 seconds"

# Data
  ExpiresByType text/xml "access plus 0 seconds"
  ExpiresByType application/xml "access plus 0 seconds"
  ExpiresByType application/json "access plus 0 seconds"

# Feed
  ExpiresByType application/rss+xml "access plus 1 hour"
  ExpiresByType application/atom+xml "access plus 1 hour"

# Favicon (cannot be renamed)
  ExpiresByType image/x-icon "access plus 1 week"

# Media: images, video, audio
  ExpiresByType image/gif "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/jpg "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType video/ogg "access plus 1 month"
  ExpiresByType audio/ogg "access plus 1 month"
  ExpiresByType video/mp4 "access plus 1 month"
  ExpiresByType video/webm "access plus 1 month"

# HTC files (css3pie)
  ExpiresByType text/x-component "access plus 1 month"

# Webfonts
  ExpiresByType application/x-font-ttf "access plus 1 month"
  ExpiresByType font/opentype "access plus 1 month"
  ExpiresByType application/x-font-woff "access plus 1 month"
  ExpiresByType image/svg+xml "access plus 1 month"
  ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# CSS and JavaScript
  ExpiresByType text/css "access plus 1 year"
  ExpiresByType application/javascript "access plus 1 year"

  <IfModule mod_headers.c>
    Header append Cache-Control "public"
  </IfModule>

</IfModule>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/javascript
<IfModule mod_setenvif.c>
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>

# Prevent Directoy listing 
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
 Order deny,allow
 Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 

RewriteBase /
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200

# 7. disable open_basedir limitations
# php_admin_value open_basedir none

Newbie

Posts

Joined
Thu Dec 29, 2011 6:07 am

Post by IP_CAM » Sun Mar 06, 2016 9:15 am

You should just be aware, that your Shop could end up, not been accepted/passed as Secure Site, if you have parts of the software functioning on non-ssl-requests.
Just to mention it.
Ernie
openshop.li

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by EvolveWebHosting » Sun Mar 06, 2016 9:54 am

Are you running a browser extension that tries to force SSL for every page you view (including sites that are not yours) or is there an SSL related module you're using on your site?

2 Week FREE Trial of our Shared Hosting plans (DIrectAdmin or cPanel) for new customers
2 Week FREE Trial of Astra Firewall and Malware Scanner
Visit our website for full details and to start your trial today - www.evolvewebhost.com


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA

Post by Josetxu » Sun Mar 06, 2016 10:08 am

SSL is not forcing the browser, if this happens, also the main page would appear SSL.

This is the web: rc-innovations.es

Newbie

Posts

Joined
Thu Dec 29, 2011 6:07 am

Post by EvolveWebHosting » Sun Mar 06, 2016 11:21 am

Josetxu wrote:SSL is not forcing the browser, if this happens, also the main page would appear SSL.

This is the web: rc-innovations.es
I was asking if you had a browser extension like this to Force SSL on sites you visit.

https://addons.mozilla.org/en-US/firefo ... verywhere/


Take a look in the controller file for the product.php file. catalog/controller/product/product.php

'href' => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id'])

You will probably find 'SSL' in one of the href lines and it shouldn't be there.

2 Week FREE Trial of our Shared Hosting plans (DIrectAdmin or cPanel) for new customers
2 Week FREE Trial of Astra Firewall and Malware Scanner
Visit our website for full details and to start your trial today - www.evolvewebhost.com


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA

Post by Josetxu » Sun Mar 06, 2016 7:55 pm

Hi,

I found the source of the problem, in a modification of category.php, I disabled the "~" file and ssl not working.
modification/catalog/controller/product->category.php

I searched several lines of code with the word "SSL". Should I delete all lines SSL or only one?

Code: Select all

$totalpages = ceil($pagination->total/$pagination->limit);
				if (isset($this->request->get['page'])) {
					$this->document->addLink($this->url->link('product/category','path=' . $this->request->get['path'].$url,'SSL'),'canonical');
				}
				if($page == 1 && $page < $totalpages) {
					$this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path'].$url."&page=2",'SSL'), 'next');
				}

				if($page > 1 && ($page < $totalpages)) {
					$pagenumbernext = $page + 1;
					$pagenumberprev = $page - 1;
					$this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path'].$url."&page=".$pagenumbernext,'SSL'), 'next');
					$this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path'].$url."&page=".$pagenumberprev,'SSL'), 'prev');
				}


				if($page > 1 && ($page == $totalpages)) {
					$pagenumber = $page - 1;
					$this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path'].$url."&page=".$pagenumber,'SSL'), 'prev');
				}
				
			$pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}');

			$data['pagination'] = $pagination->render();

			$data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit));

			// http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html
			if ($page == 1) {
			    $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'], 'SSL'), 'canonical');
			} elseif ($page == 2) {
			    $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'], 'SSL'), 'prev');
			} else {
			    $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page - 1), 'SSL'), 'prev');
			}

			if ($limit && ceil($product_total / $limit) > $page) {
			    $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1), 'SSL'), 'next');

Code: Select all

if($this->config->get("nerdherd_direct_links")) {
	$link = $this->url->link('product/product','product_id=' . $result['product_id'],'SSL');
} else {
    $link = $this->url->link('product/product','path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url,'SSL');

Code: Select all

				$totalpages = ceil($pagination->total/$pagination->limit);
				if (isset($this->request->get['page'])) {
					$this->document->addLink($this->url->link('product/category','path=' . $this->request->get['path'].$url,'SSL'),'canonical');
				}
				if($page == 1 && $page < $totalpages) {
					$this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path'].$url."&page=2",'SSL'), 'next');
				}

				if($page > 1 && ($page < $totalpages)) {
					$pagenumbernext = $page + 1;
					$pagenumberprev = $page - 1;
					$this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path'].$url."&page=".$pagenumbernext,'SSL'), 'next');
					$this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path'].$url."&page=".$pagenumberprev,'SSL'), 'prev');
				}


				if($page > 1 && ($page == $totalpages)) {
					$pagenumber = $page - 1;
					$this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path'].$url."&page=".$pagenumber,'SSL'), 'prev');
				}
				
			$pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}');

			$data['pagination'] = $pagination->render();

			$data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit));

			// http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html
			if ($page == 1) {
			    $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'], 'SSL'), 'canonical');
			} elseif ($page == 2) {
			    $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'], 'SSL'), 'prev');
			} else {
			    $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page - 1), 'SSL'), 'prev');
			}

			if ($limit && ceil($product_total / $limit) > $page) {
			    $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1), 'SSL'), 'next');

Newbie

Posts

Joined
Thu Dec 29, 2011 6:07 am

Post by Josetxu » Mon Mar 07, 2016 8:41 am

Hi,

I solved the problem, I removed "SSL" in these two lines of code:

Code: Select all

if($this->config->get("nerdherd_direct_links")) {
   $link = $this->url->link('product/product','product_id=' . $result['product_id'],'SSL');<<--- DELETE
} else {
    $link = $this->url->link('product/product','path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url,'SSL'); <<----DELETE 

Newbie

Posts

Joined
Thu Dec 29, 2011 6:07 am
Who is online

Users browsing this forum: No registered users and 182 guests