Page 1 of 1
Gold R8 Private Products HTTP 302
Posted: Tue Mar 10, 2015 6:26 am
by AbleMods
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?
Re: Gold R8 Private Products HTTP 302
Posted: Wed Mar 11, 2015 1:01 am
by mazhar
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.