Post by Storeship » Wed Nov 16, 2016 4:12 pm

Hi,
I am currently having problems with my URLS, after loads of tweaking and messing around i have finally got my site SSL'd up and SEO urls working however, when i click into a category or brand/manufacturer when i click a product from there the url's change and force the product to become another level url within the structure, surely it should be one url for each product e.g.

I have this product for sale, when clicked through from home page or directly url is:
https://discountaftershave.com/pall-mall-moustache-wax

If i click through from category page (mens-grooming) i get:
https://discountaftershave.com/mens-gro ... stache-wax

This is causing loss of images and stylesheets etc and is not right, any help would be appreciated.

Also why do non of the account pages seo urls work e.g. affiliate etc??

Thanks

Newbie

Posts

Joined
Wed Sep 07, 2016 7:00 pm
Location - Nottingham, UK

Post by thekrotek » Wed Nov 16, 2016 5:51 pm

That's actually how OpenCart works. When you browse the categories or manufacturers and finally click a product link, parent category or manufacturer is added to URL. For all other cases product link is "direct".

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by knowband.plugins » Wed Nov 16, 2016 5:57 pm

It is modifying css and images url too and therefore all media files are not being loaded.

eg: https://discountaftershave.com/mens-gro ... stache-wax

All images and css files are being modified to include mens-grooming in the url which should not be done.

Visit https://discountaftershave.com/mens-gro ... stache-wax and open browser console to view errors.

Regards,
Knowband Team

Opencart Plugins: Knowband Store
Email: support@knowband.com


User avatar
Active Member

Posts

Joined
Thu Aug 04, 2016 2:56 pm

Post by Storeship » Wed Nov 16, 2016 6:30 pm

Surely by adding manufacturers and categories to the product URL's you are then making 3 separate product urls which is not good seo practice?

So how should this be fixed, i understand what is wrong with it just need a little push in the direction of fixing it?

I would prefer the category and brand/manufacturer links to just link to the product page.

Thanks in advance

Newbie

Posts

Joined
Wed Sep 07, 2016 7:00 pm
Location - Nottingham, UK

Post by thekrotek » Wed Nov 16, 2016 6:34 pm

Storeship wrote:Surely by adding manufacturers and categories to the product URL's you are then making 3 separate product urls which is not good seo practice?
Pages still have canonical link defined in header, so shouldn't actually matter.
Storeship wrote:I would prefer the category and brand/manufacturer links to just link to the product page.
This can be achieved either by modifying the code, which is quite painful in this case, or with redirects. I'm pretty sure there're tons of SEO extensions, which can do that. But I'd leave it as is, there's nothing bad with such behavior, because, like I said, canonical links are defined properly.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by Storeship » Wed Nov 16, 2016 6:38 pm

thekrotek wrote:
Storeship wrote:Surely by adding manufacturers and categories to the product URL's you are then making 3 separate product urls which is not good seo practice?
Pages still have canonical link defined in header, so shouldn't actually matter.
Storeship wrote:I would prefer the category and brand/manufacturer links to just link to the product page.
This can be achieved either by modifying the code, which is quite painful in this case, or with redirects. I'm pretty sure there're tons of SEO extensions, which can do that. But I'd leave it as is, there's nothing bad with such behavior, because, like I said, canonical links are defined properly.
OK, understand that but what about lost images and stylesheets, i assume they are relative urls's hence being unfound?

Newbie

Posts

Joined
Wed Sep 07, 2016 7:00 pm
Location - Nottingham, UK

Post by hnrindani » Wed Nov 16, 2016 7:01 pm

This is how Opencart works:

1. If you add a menu item, Opencart will add the item in URL as http://www.domain.com/menuitem1
2. Sub menus are further added to the URL making it as http://www.domain.com/menuitem1/SubMenus
3. Now for further categories, it will be then added to the URL and thus making it longer.

What you can do is build canonical around the URL to make it user friendly. Alternatively you can have redirects with is a cumbersome task but these are the options you may look for.

Supporting Clients to manage their web products and helping them with Social media promotions. Looking after OpenCart and Umbraco sites at Cygnet. (http://www.cygnet-infotech.com)


Newbie

Posts

Joined
Mon Nov 07, 2016 4:47 pm


Post by thekrotek » Wed Nov 16, 2016 8:52 pm

Storeship wrote:OK, understand that but what about lost images and stylesheets, i assume they are relative urls's hence being unfound?
Something's bad in configuration. Start with checking .htaccess file. There's a "RewriteBase" parameter out there. Next thing to check is HTTP_CATALOG and HTTPS_CATALOG constants in config.php.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by Storeship » Wed Nov 16, 2016 9:02 pm

.htaccess

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

# www to non-www redirect
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://discountaftershave.com/$1 [R,L]

RewriteCond %{HTTPS} !=on
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/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]

Do not have HTTP_CATALOG and HTTPS_CATALOG constants defined in config.php.

Newbie

Posts

Joined
Wed Sep 07, 2016 7:00 pm
Location - Nottingham, UK

Post by thekrotek » Wed Nov 16, 2016 9:16 pm

Storeship wrote:Do not have HTTP_CATALOG and HTTPS_CATALOG constants defined in config.php.
It's HTTP_SERVER and HTTPS_SERVER, my bad, sorry. HTTP_CATALOG is for admin config.php only.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by artcore » Wed Nov 16, 2016 9:18 pm

I remember that issue from another post: viewtopic.php?f=16&t=166036&p=632742#p632732
Basically your base href should be static or css and others won't be found.

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by Storeship » Wed Nov 16, 2016 10:38 pm

artcore wrote:I remember that issue from another post: viewtopic.php?f=16&t=166036&p=632742#p632732
Basically your base href should be static or css and others won't be found.
Thanks Artcore, that worked.
If anyone else requires fix its as follows:

catalog/controller/common/header.php

replace this code

Code: Select all

$data['base'] = $server;
with this code

Code: Select all

$data['base'] = $this->config->get('config_store_id') == 0 ? HTTPS_SERVER : $server;

Newbie

Posts

Joined
Wed Sep 07, 2016 7:00 pm
Location - Nottingham, UK

Post by artcore » Thu Nov 17, 2016 12:26 am

Glad you got it solved,
Cheers

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by thekrotek » Thu Nov 17, 2016 3:39 am

Storeship wrote:If anyone else requires fix its as follows:

catalog/controller/common/header.php

replace this code

Code: Select all

$data['base'] = $server;
with this code

Code: Select all

$data['base'] = $this->config->get('config_store_id') == 0 ? HTTPS_SERVER : $server;
That's interesting. I understand the replacement and what's the reason of the issue. Yet I remember fixing this on my SSL-enabled site without any changes to the "base" parameter. Unfortunately, I completely forgot the routine. Only remember playing with .htaccess and config.php.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 6 guests