Gold R8 Private Products HTTP 302

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Gold R8 Private Products HTTP 302

Post by AbleMods » Tue Mar 10, 2015 6:26 am

We've noticed that products marked as 'private' are issued a 302 redirect. We'd like to change that to be a 301 redirect.

Is it possible to change how redirects are fired based on product visibility?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Gold R8 Private Products HTTP 302

Post by mazhar » Wed Mar 11, 2015 1:01 am

I think this is default behavior of ASP.NET Response.Redirect function. You can try using Response.RedirectPermanent. If you edit Website/Product.aspx.cs file and locate following code.

Code: Select all

if ((_product.Visibility == CatalogVisibility.Private) &&
                    (!AbleContext.Current.User.IsInRole(Role.CatalogAdminRoles)))
                {
                    Response.Redirect(NavigationHelper.GetHomeUrl());
                }
You can update it like

Code: Select all

if ((_product.Visibility == CatalogVisibility.Private) &&
                    (!AbleContext.Current.User.IsInRole(Role.CatalogAdminRoles)))
                {
                    Response.RedirectPermanent(NavigationHelper.GetHomeUrl());
                }
That should do the trick.

Post Reply