Duplicate folders in path e.g. store/store with virtual folders

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hi

Had a problem recently which isn't quite fixed.  This pretty sure point 2 is an issue, otherwise the help/validation may just need to be more specific.  I'll try to explain:  

The shop is running under a virtual directory on IIS ie www.mydomain.com/store/

On the store we'd enabled SSL and specified the urls:

url:     http://www.mydomain.com/store/
sslurl:  https://www.mydomain.com/store/

However when we loaded a front end page images were not loading because the image url include /store/store e.g.

http://www.mydomain.com/store/store/content/images ....

Problem 1:

The logic to get the host name in Nop.Core.WebHelper.GetStoreHost checks if SSL is enabled and if a secure url is specified it uses that - so it gets https://www.mydomain.com/store/

But the calling method GetStoreLocation - then picks up the application path from the httpContext and adds it to the url - so we end up with https://www.mydomain.com/store/store/

Problem 2:
I haven't replicated this but looking at the logic of GetStoreHost - if the http host header was not available (rare I guess) it would pick up the specified store location in url and you would have the same problem as the url has /store and the calling method GetStoreLocation would add the application path.

Problem 3:
We now have SSL enabled, a blank sslurl but the url specified as http://www.mydomain.com/store/.

So this fixes problem 1, problem 2 could still be an issue as described, but the problem I'm left with is that on the Admin section its not applying the en-US culture.  So date validation doesn't work with the Telerik controls.  Having checked the GetStoreLocation I can't see how this is possible with the current configuration - and I can't replicate it but I can only assume that path comparison done in SetWorkingCulture (global.asax.cs) is not getting the right path.

Solutions:

1.  Maybe the url / sslurl should only every have the host name in it and not the path?  The only trouble with that is we have at least one plugin that gets the store location direct from the store (it does not use the WebHelper) - in which case the path would be wrong.  

I definitely think it should be clearer that the sslurl is only really required if the ssl url (ssl host?) is different to the non-ssl url/host

2.  The GetStoreHost should strip any path before returning the store host - then append the application path in GetStoreLocation.


Thoughts appreciated, Scott
7 years ago
Should have said - its nop 3.7
6 years ago
I have this same issue. However, all of my images load correctly, but links such as password recovery and account validation   have the duplicate store name: http://storeurl.com/storename/storename/passwordrecovery/confirm?token........ and thus fail for the user unless they remove the extra url segment.
6 years ago
Thanks! We'll check it - https://github.com/nopSolutions/nopCommerce/issues/2833
6 years ago
hepshaw wrote:
I have this same issue.


Done. You can see changes here.
Thanks for the suggestion.
6 years ago
Thank you for your prompt fix. I applied your changes to my solution and it provides the correct path in the URL. However in my testing the ? (query string) in the email is encoded causing a server error.

The link returned in the email is:

http://store.com/store/passwordrecovery/confirm%3Ftoken=a5cbd248-c503-414f-9a8b-cdcbc9f8269a&[email protected]
6 years ago
hepshaw wrote:
However in my testing the ? (query string) in the email is encoded causing a server error.


You are right. We have fixed this error. You can see changes in this commit.
Thanks again.
6 years ago
Thank you. I have validated that this works as intended.
5 years ago
I have the problem on my site. how can i solve it.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.