Post by brasseurs » Tue Jan 20, 2015 2:26 am

Hi,

I have recently installed a SSL on my opencart and since, URL's SEo doesn't work correctly.

SEO are actived , it's probably a .htacess problem...

Example:
In the category equipment I have this url : https://www.brasseursartisans.com/index ... quipements

And I want : https://www.brasseursartisans.com/equipements

Can you help me?

Thanks

Newbie

Posts

Joined
Tue Jan 20, 2015 2:15 am

Post by brasseurs » Wed Jan 21, 2015 2:54 am

This is my full .htaccess:

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

# Prevent Directoy listing 
Options -Indexes

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

#.htaccess SETTINGS TO TURN OFF  
# STUPID MAGIC QUOTES IN PHP  
# I HATE MAGIC QUOTES PROBLEMS  
#php_flag magic_quotes_gpc off 

# 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 ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [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]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ https://www.brasseursartisans.com? [R=301,L]

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

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Newbie

Posts

Joined
Tue Jan 20, 2015 2:15 am

Post by fido-x » Mon Jan 26, 2015 10:25 pm

That's a strange one. Mousing over the links shows the correct SEO enabled URL. But, when clicked, you get a different result (as you stated) in the address line. This may also be related to links not being SSL enabled in the controllers.

Try this: in catalog/controller/module/category.php, change line 46 from:

Code: Select all

'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
to:

Code: Select all

'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id', 'SSL'])
And line 60 from:

Code: Select all

'href'        => $this->url->link('product/category', 'path=' . $category['category_id'])
to:

Code: Select all

'href'        => $this->url->link('product/category', 'path=' . $category['category_id', 'SSL'])
And see if that works in the module. If it does, similar changes would probably be needed in the category controller (and possibly others).

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by brasseurs » Tue Jan 27, 2015 2:26 am

Hi Fido-x,

The manipulation doesn't work..

This is my code (Not the same synthaxe of your exemple):

Code: Select all

);		
					    $product_total = $this->model_catalog_product->getTotalProducts($data);
						if ($this->config->get('config_product_count')) {
						$l3_data[] = array(
							'category_id' => $l3['category_id'],
							'name'        => $l3['name']. ' (' . $product_total . ')',
							'href'        => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']. '_' . $l3['category_id'])
						);
						} else {
						$l3_data[] = array(
							'category_id' => $l3['category_id'],
							'name'        => $l3['name'],
							'href'        => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']. '_' . $l3['category_id'])
						);
						}
					}

Newbie

Posts

Joined
Tue Jan 20, 2015 2:15 am

Post by fido-x » Tue Jan 27, 2015 8:44 am

Looks like you've had some custom modifications done to the controller (e.g. $13_data) which may be interfering with SEO URLs.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by brasseurs » Sun Mar 01, 2015 9:40 pm

Thanks Again Fido-x!

But since, I didn't solve my problem... Someone have any idea?

Thanks


Brasseurs

Newbie

Posts

Joined
Tue Jan 20, 2015 2:15 am

Post by werwolf648 » Sun Jun 28, 2015 4:59 pm

I have same problem - I need all pages to be in linked in https. Any Rewrite in htaccess I tried makes all links non-seo.
+ this trick anyway doesn't work with FB iframe tab - because last just doesn't allow to follow not secured links

Newbie

Posts

Joined
Thu Jun 25, 2015 4:23 pm

Post by Elnino3838 » Tue Jan 19, 2016 5:47 pm

Same Prob here.

I guess we all want SSL everywhere for SEO purposes (new Google guidelines) but as long as you add something like this in your .htaccess to force all pages to load in https:

Code: Select all

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
URLs are no longer SEO friendly.

That's too bad. I am sure I did not modify the controller (don't have the skill for that!). Any help on this?

Thanks!

Calgary Web Design - http://www.beginwithb.com


Newbie

Posts

Joined
Wed Feb 20, 2013 5:37 am

Post by jrfcomputing » Tue Jan 19, 2016 6:03 pm

My SSL works for the whole site.

First I changed the config.php in both admin and root directories
Then I logged into admin and settings and turned ssl on there

Then added Code below to my htaccess file.

Code: Select all

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

Opencart sites I am currently working on:
http://www.cablecafe.co.uk
http://www.exclusivelygorgeous.co.uk/


User avatar
Active Member

Posts

Joined
Mon May 09, 2011 11:29 pm

Post by jrfcomputing » Wed Jan 20, 2016 12:30 am

If you use Openbay pro for ebay you also need to add this code to .htaccess

Code: Select all

RewriteCond %{QUERY_STRING} !^route=ebay/openbay/*
under

Code: Select all

RewriteCond %{HTTPS} off
Before

Code: Select all

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

Opencart sites I am currently working on:
http://www.cablecafe.co.uk
http://www.exclusivelygorgeous.co.uk/


User avatar
Active Member

Posts

Joined
Mon May 09, 2011 11:29 pm

Post by Elnino3838 » Wed Jan 20, 2016 5:28 pm

@jrfcomputing:

Your method is the same as the one I've tried. Yes the SSL works everywhere but no your URL are no longer SE friendly as it can read "index.php?route=....", at least on my OC 1.5.5.1 version.

I finally ended up buying this extension Force SSL Everywhere http://www.opencart.com/index.php?route ... n_id=22017 which works beautifully and keeps URL Search Engine Friendly.

Cheers.

Calgary Web Design - http://www.beginwithb.com


Newbie

Posts

Joined
Wed Feb 20, 2013 5:37 am

Post by jrfcomputing » Fri Jan 22, 2016 5:50 pm

@Elnino3838

Look at the code there is a difference. It works fine for me and my pages are all SEO friendly

Opencart sites I am currently working on:
http://www.cablecafe.co.uk
http://www.exclusivelygorgeous.co.uk/


User avatar
Active Member

Posts

Joined
Mon May 09, 2011 11:29 pm

Post by Elnino3838 » Mon Jan 25, 2016 4:28 pm

The difference doesn't come from the .htaccess code (it's basically the same). It's probably due to the difference in version. I'm running OC 1.5.5.1 and you are running 1.5.6.4.

Calgary Web Design - http://www.beginwithb.com


Newbie

Posts

Joined
Wed Feb 20, 2013 5:37 am

Post by Melvin.C » Mon Sep 12, 2016 11:48 am

Hey, Pros, My Friend built a webiste for me to start my business.we do LED Lights.

But right now we have a SEO URL problem with the site built with OPENCART.

Here is it :
http://www.theledmaster.com/Car-Racing- ... lood-Light
http://www.theledmaster.com/LED-Lightin ... lood-Light
http://www.theledmaster.com/LED-Lightin ... lood-Light
Basicly these three are the same product, but there are three different URL.that is not good for SEO.
And my friend is on vocation, he will not return till 8th Oct.
Can someone help me out ? Please.
Contact me at:
melvincheung228@gmail.com
Thanks.

Newbie

Posts

Joined
Mon Sep 12, 2016 11:41 am

Post by ADD Creative » Tue Sep 13, 2016 6:12 pm

That is just the way OpenCart works. If you look at the page source you will see the canonical URL is set to the same for all pages.

Code: Select all

<link href="http://www.theledmaster.com/Car-Racing-Lighting-1000-Watt-LED-Flood-Light" rel="canonical" />
This tells search engines that they are all the same page and to use the URL in the canonical link when indexing. It should not be a problem.

ADD Creative - Web development and e-commerce development, Milton Keynes or Christchurch, UK
ADD Filtration - HVAC Panel Filters, Bag Filters and HEPA Filters


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am

Post by zaidladha » Fri May 12, 2017 4:44 am

jrfcomputing you helped me a lot

I couldn't get the add to cart working on my home page but your code worked great for me, and I still have SEO friendly URLS.

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


Thank You!!!

New member

Posts

Joined
Wed Jun 05, 2013 3:07 pm
Who is online

Users browsing this forum: No registered users and 17 guests