Hello Everyone!
I'm working on nopCommerce 3.60, and I have a doubt regarding the redirecting done on the GetRouteData inside GenericPathRoute controller.
In case you hit a product slug that is inactive, code will redirect you to the most up to the date version of the URL.
Redirecting is done through this code:
var response = httpContext.Response;
response.Status = "301 Moved Permanently";
response.RedirectLocation = string.Format("{0}{1}", webHelper.GetStoreLocation(false), activeSlug);
response.End();
In my case, the website is running on a SSL website, and the redirecting to HTTPS is done through the webconfig.
When you hit webHelper.GetStoreLocation(false), even in secure environment, it will redirect me first to the HTTP version, and then to the HTTPS version, creating two redirects.
Multiple redirects for one product is bad for SEO, so I want to fix this. This could be done easily by setting to true with a store setting the method GetStoreLocation.
My doubt is: Do we have to make it so that the false is passed for a reason, or is it safe to do this change? It is a very simple mistake, and this sort of code usually makes me think twice before making a change.
Thanks!