I am having a very peculiar issue. For some specific url nop website redirects to another url. For example -
This is the url that is supposed to go -
when clicked or even pasted in address bar, I debugged the code and in the application_beginrequest
method notice the url -
(notice the Path property of Request object)
It automatically changed from category_whisky-american-sour-mash
to shipping-and-returns
. Checked both the SEO urls from category and page but no duplicates.
I checked for SEO urls and there is only one entry, so no possible way of duplication
I am trying to solve this for almost a day now. Can anybody help? Why is this happening? I am relatively new to NopCommerce. Any suggestion is appreciated.
Okay, after one and half day of trying I finally found the fix. I thought I should post the solution here.
It is due to wrong
Slug
values. In theUrlRecordService
this method caches the slug by putting""
if no slug found -Which ends creating a lot of urls with blank slugs. To fix this, you should do the followings -
then add check to ignore slugs with
isActive = False
-Also don't forget to clear cookie and restart your server just in case.
So, far this solved my problem.