If this is your first visit, check our documentation. To post, register or login.
Forums / Business Issues / Search Engines / Best 301 redirect for moving products that seem to have multiple viewing paths

Best 301 redirect for moving products that seem to have multiple viewing paths

Started by kcb410 on 16 Apr 2019, 1:53 PM · Views: 119

Results 1 to 11 of 11
16 Apr 2019, 1:53 PM
#1
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Best 301 redirect for moving products that seem to have multiple viewing paths

Hello Everyone,

We're preparing to move a series of products to new locations and we've noticed that people browse these products in three different ways:

  1. The path including proper categories - index.php?main_page=product_info&cPath=6_318&products_id=2122
  2. The path including random categories - index.php?main_page=product_info&cPath=10_8&products_id=2122
  3. The path to just the product - index.php?main_page=product_info&products_id=2122

Is their one 301 redirect we can use that covers all three of these scenarios? Or do we need to create a redirect for all three?

Any help is appreciated. Thanks.

16 Apr 2019, 7:39 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Best 301 redirect for moving products that seem to have multiple viewing paths

When you say "new locations" are changing the products_id?
Are the products still going to be linked like the example shown by the first two links?
Also regarding "new locations" are they still going to be at the same domain?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

16 Apr 2019, 8:04 PM
#3
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Re: Best 301 redirect for moving products that seem to have multiple viewing paths

Thanks for the reply mc12345678!

Answers to your questions are shown below.

When you say "new locations" are changing the products_id? Yes
Are the products still going to be linked like the example shown by the first two links? No they'll be in new category/sub categories
Also regarding "new locations" are they still going to be at the same domain? Yes

Regards,

Paul

16 Apr 2019, 9:01 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Best 301 redirect for moving products that seem to have multiple viewing paths

Why are the products_id's being changed instead of just modifying the associated content?

The cPath information provides a sort of "flavor" to the product as in to what category (and therefore related product) does it exist. Effectively when included in the browser address it populates the breadcrumbs identifying in which category tree it exists.

Unless you plan on updating the rewrites to keep track of the history of each category and the product within it, I would recommend a 301 (RewriteCond/RewriteRule) that uses the products_id with it found anywhere in the uri as being the first and only parameter, the first parameter, a middle parameter and an end parameter... And rewrite to not include/worry about the cPath possibly stripping it so that other parameters (zenID) can still be passed along.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

16 Apr 2019, 10:04 PM
#5
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Re: Best 301 redirect for moving products that seem to have multiple viewing paths

Thanks again mc12345678.

Based on your description would something like this work properly?

RewriteCond %{QUERY_STRING} products_id=old $ [NC]
RewriteRule ^(.*) products_id=new [R=301,L]

16 Apr 2019, 11:51 PM
#6
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Best 301 redirect for moving products that seem to have multiple viewing paths

kcb410:

Hello Everyone,

We're preparing to move a series of products to new locations and we've noticed that people browse these products in three different ways:

  1. The path including proper categories - index.php?main_page=product_info&cPath=6_318&products_id=2122
  1. The path including random categories - index.php?main_page=product_info&cPath=10_8&products_id=2122
  1. The path to just the product - index.php?main_page=product_info&products_id=2122

Is their one 301 redirect we can use that covers all three of these scenarios? Or do we need to create a redirect for all three?

Any help is appreciated. Thanks.The canonical link to these 3 is the same, check the source.
The path to get to the product is ignored.
Copying (linking) these products to "different" places doesn't require a redirect as the "new path" is not relevant

The more important question is....
Why are you creating NEW products instead of reusing the existing product?

17 Apr 2019, 2:11 PM
#7
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Re: Best 301 redirect for moving products that seem to have multiple viewing paths

gilby:

The canonical link to these 3 is the same, check the source.
The path to get to the product is ignored.
Copying (linking) these products to "different" places doesn't require a redirect as the "new path" is not relevant

The more important question is....
Why are you creating NEW products instead of reusing the existing product?

Thanks for the reply.

We're not creating new products but a group of products are being migrated to a new cms.

17 Apr 2019, 2:26 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Best 301 redirect for moving products that seem to have multiple viewing paths

kcb410:

Thanks for the reply.

We're not creating new products but a group of products are being migrated to a new cms.

New as in not ZC?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

17 Apr 2019, 2:30 PM
#9
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Re: Best 301 redirect for moving products that seem to have multiple viewing paths

That's correct mc12345678.

17 Apr 2019, 2:47 PM
#10
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Re: Best 301 redirect for moving products that seem to have multiple viewing paths

When we use this:

RewriteCond %{QUERY_STRING} products_id=1$ [NC]
RewriteRule ^(.*) /bw-10-printed-envelopes [R=301,L]

When we paste the old url it redirects to the proper product but with an URL that looks like this:

www.the domain.com/bw-10-printed-envelopes?main_page=product_info&cPath=8_1_381&products_id=1

Which looks odd... but I'm not sure if that's what the redirect is supposed to look like.

17 Apr 2019, 7:30 PM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Best 301 redirect for moving products that seem to have multiple viewing paths

kcb410:

When we use this:

RewriteCond %{QUERY_STRING} products_id=1$ [NC]
RewriteRule ^(.*) /bw-10-printed-envelopes [R=301,L]

When we paste the old url it redirects to the proper product but with an URL that looks like this:

www.the domain.com/bw-10-printed-envelopes?main_page=product_info&cPath=8_1_381&products_id=1

Which looks odd... but I'm not sure if that's what the redirect is supposed to look like.

It is not supposed to look like that (meaning that is not the desired result).

This has been tested to work with products_id being first, middle or last, though as written it will keep all of the other data in it:

RewriteCond %{QUERY_STRING} (.*)(products_id)=511([&]+&?(.*)|$) [NC]
RewriteRule ^ %{REQUEST_URI}?%1%2=78%3 [R=302,L]

This would take a uri such as: server /index.php?main_page=product_info&cPath=x&products_id=511 and change it to:
server /index.php?main_page=product_info&cPath=x&products_id=78.

If there were other parameters after the original 511, then they would be added to the end of the result. If the products_id parameter were up front, then everything after products_id=511 would be after 78....

A problem with the rewrite that was generated is that if the address entered did not end with a 1 (ie. perhaps a link saved with a session on it), then the rewrite would fail. The above rewrite was also tested with a products_id of 5111 to ensure that it filtered properly.

Now as for the rewrite to give like described of bw-10-printed-envelopes, well would need to use that or similar instead of the right side of the RewriteRule I provide above. I offered what was described: change products_id=x to products_id=y.... What has been demonstrated is something different.

The other thing is did you know that you could obtain the same type of URI by using the Ceon URI Mapping module? But then again, that would require the product to remain in the current cart...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...