Duplicate urls for products

  • Posts: 13
  • Thank you received: 0
13 years 2 months ago #25184

Hi!
I have a problem with multiple product URLs in our shop at www.stattgarde.de/duty-free-shop .

The product-module associated to the menu item is set to show all products in all sub-categories to show every product on the front page. Additionally there is a category listing module in the sidebar to mimic a "filter by category" behavior.
When I see a product in the root page it has a link like

/duty-free-shop/product/6-regenschirm-groß

When I click on the same item it in a sub-category, it has a link like

/duty-free-shop/product/6-regenschirm-groß/category_pathway-15

which is basically the same URL with the category-ID appended.

On top of that, I have a "related products" module which then adds another suffix to the URL:

/duty-free-shop/product/6-regenschirm-groß/category_pathway-15/related_product-7


This makes at least 4 URLs (not taking in account products in multiple categories) for this product.
Is there a way to remove the redundant parts (category, related) of the URL (without elaborate rewrite-rules)?

Kind regards,
Simon

Last edit: 13 years 2 months ago by stattgarde.

Please Log in or Create an account to join the conversation.

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
13 years 2 months ago #25191

Hi,

No, that's not possible. These additional parameters are necessary in order to generate a correct breadcrumb on the product page. Without them, the breadcrumb would always be the same one regardless from where the user is coming.
You would have been to have URL rewrite rules in your htaccess if you want to have only one URL, but your breadcrumb will always show the same path for a product regardless of the path your user used to come to that page.

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
13 years 2 months ago #25241

Thanks for the help, I created a rewrite rule for that:

RewriteCond %{REQUEST_URI}  ^(/duty-free-shop/produkt/.*)/(category_pathway|related_product)-[0-9]+$
RewriteRule .*              %1            [R=301,L]
The breadcrumbs do not really matter because the structure used is very flat and there is no need for the categories to appear in the breadcrumbs.
Anyway, I don't see the reason, why related products should anything have to do with the breadcrumbs; that solution/feature seems kind of strange because it assumes a hierarchy between two related products. A config-option to disable that would be nice.

(If anybody has the same problem and wants to use the above solution, you have to substitute the part "/duty-free-shop/produkt/" to your site configuration [the first being the shop-menu-item-alias, the second the SEF-URL-configuration-value for products in Hikashop])

Please Log in or Create an account to join the conversation.

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
13 years 2 months ago #25245

Thank you for the feedback. We'll look at adding an option for that in the future.

Please Log in or Create an account to join the conversation.

  • Posts: 152
  • Thank you received: 0
13 years 2 months ago #25292

I'm having the same issue with my site and agree with Simon, it would be great to see this option in a future release.

Also, I'm going to try and set up the .htaccess rewrite code posted above. However, I'm new to editing an .htaccess file so would appreciate some help here...

OK so, our shop is in the main directory of our site and our SEF options are set as below:



So, would our rewrite rule be this?...
RewriteCond %{REQUEST_URI}  ^(/category/.*)/(category_pathway|related_product)-[0-9]+$
RewriteRule .*              %1            [R=301,L]


Create your own style of luxury bespoke furniture online
Attachments:
Last edit: 13 years 2 months ago by plantpotphil.

Please Log in or Create an account to join the conversation.

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
13 years 2 months ago #25293

The duty-free-shop/produkt part should be replaced by the alias of your menu as stattgarde said in his post, not by the value of the category SEF name option of the config.

Please Log in or Create an account to join the conversation.

  • Posts: 152
  • Thank you received: 0
13 years 2 months ago #25294

oh yeah, sorry, my mistake.

I link to our shop via several category listings from the main menu. So would I use the alias of each of these menu items and have a new rewrite code for each? So for example, a menu which links to a category with the alias "furniture" would be:

RewriteCond %{REQUEST_URI}  ^(/furniture/.*)/(category_pathway|related_product)-[0-9]+$ 
RewriteRule .*              %1            [R=301,L]

Bearing in mind settings in SEF are:



Thanks for any help,

Phil


Create your own style of luxury bespoke furniture online
Last edit: 13 years 2 months ago by plantpotphil.

Please Log in or Create an account to join the conversation.

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
13 years 2 months ago #25295

I suppose yes.

Please Log in or Create an account to join the conversation.

  • Posts: 152
  • Thank you received: 0
13 years 2 months ago #25298

I can't seem to get this to work (probably because I'm an idiot...)

I'm only interested in removing the "related_product" part at the end.

So, for example:

/furniture/30-small-chair
LINKS TO RELATED PRODUCT:
/furniture/31-medium-chair/related_product-30

Should be:

/furniture/30-small-chair
LINKS TO RELATED PRODUCT:
/furniture/31-medium-chair

I've added the following to the end of the .htaccess file:

RewriteCond %{REQUEST_URI} ^(/furniture/.*)/(related_product)-[0-9]+$  
RewriteRule .*              %1            [R=301,L] 

Can anyone see why this might not work? :huh:

Phil


Create your own style of luxury bespoke furniture online

Please Log in or Create an account to join the conversation.

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
13 years 2 months ago #25305

Do you have the mod_rewrite engine activated ?

If not, you should have the lines below before your code in the htaccess file:
Options +FollowSymLinks
RewriteEngine On

Please Log in or Create an account to join the conversation.

  • Posts: 152
  • Thank you received: 0
13 years 2 months ago #25326

yeah those lines are part of the original joomla htaccess file near the top. I haven't altered them.


Create your own style of luxury bespoke furniture online

Please Log in or Create an account to join the conversation.

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
13 years 2 months ago #25329

Then it should work. I'm afraid I don't have other ideas.

Please Log in or Create an account to join the conversation.

  • Posts: 152
  • Thank you received: 0
13 years 2 months ago #25331

Thanks for trying Nicolas, I'll keep plugging away and see if I can figure out which bit isn't playing ball!


Create your own style of luxury bespoke furniture online

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
13 years 2 months ago #25447

As dicussed via PM: remove the brackets in the last part of the expression

RewriteCond %{REQUEST_URI} ^(/furniture/.*)/related_product-[0-9]+$  
RewriteRule .*              %1            [R=301,L]
and it should work

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
13 years 2 months ago #25473

I think the parameters are necessary in order to generate a correct breadcrumb. :)

Please Log in or Create an account to join the conversation.

  • Posts: 152
  • Thank you received: 0
13 years 2 months ago #25483

Thanks StattGarde, finally got it working!

I don't use a breadcrumb on our site so these changes are fine for me Mangastreamer.


Create your own style of luxury bespoke furniture online

Please Log in or Create an account to join the conversation.

  • Posts: 47
  • Thank you received: 1
11 years 9 months ago #89530

Hi there, was this problem ever sorted in newer versions of hikashop?

My client has this problem on his site. He only has 150 - 200 products, but due to all the related product URL's he literally has 1,000s of URL's generated.

I only want to have 1 URL per product, regardless of whether it is directed via a related product.

I have just purchased a new subscription and upgrade to v 2.1 (the shop was running on 1.6), but I see I still have the issue.

Please can someone advise what I need to do to fix this? (I have tried putting the code mentioned below into my htaccess file and it did nothing?)

Thanks for your help,

Keith

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 9 months ago #89663

As I said in your other topic, the last version of Hikashop should solve the problem.

Please Log in or Create an account to join the conversation.

Time to create page: 0.110 seconds
Powered by Kunena Forum