Multi Store HOST values quotation marks

10 ヶ月 前
I have a two store setup. Scheduled tasks stopped working after that setup was created.

Searched online and found the thread about store name solution. I tried several permutations, such as http://store1.com or https://store1.com or https://www.store1.com None solved it for me.

What solved the problem was changing the HOST values from store1.com,www.store1.com to “store1.com,www.store1.com” just adding these quotation marks did the trick. Scheduled tasks started working fine, particularly email.

Happy with the result, I went to do the same for store2.com. When I added the quotation marks for the host values for store2.com, like this “store2.com,www.store2.com”, now both stores starting pointing to store1.com. (So if I typed store2.com in the browser, store1.com shows up, and of course, store1.com shows store1.com).
When I removed the quotation marks from the host values for store2.com only, and kept them for store1.com, everything works fine.

I thought I’d share this with the community. This might or might not be a bug, but it might help someone with similar issues.

Current NopCommerce install: 4.60.3
Dedicated Windows server 2022.
Site bindings are all pointing to the same IP using Server Name Indication.
Each website has its own SSL certificate.

Thanks
Amen.
10 ヶ月 前
Using the quotation marks does not make sence
I guess what it might be doing for store1 is ignoring the setting in quotation maks and going with the default settings which must just happen to work for Store 1

What is in the Host values (Do you have the Advance settings displayed)
I think this is what is used to deturmine which store record to use
10 ヶ月 前
Thank you for the reply.

I agree it doesn't make sense, but that is what is happening. I double checked the behavior and it repeats for my stores. If both stores have the HTTP_HOST values with quotation marks, store2.com will point to store1.com. If only store2.com host values are without quotation marks, but store1.com has them, then each store URL works fine. I do restart the application after changing the store settings.

I discovered this behavior by accident. Running auto scheduled tasks, specifically email, stopped working after I set up the second store. Nopcommerce threads from about 5 years ago talked about proper store URL setup. Like I said above, I tried everything, scheduler will not work. Then I thought since the tool tip explaining how to setup the HTTP_HOST values has quotation marks for "store1.com,www.store1.com", I thought I'd try that. It worked. Auto scheduled sending emails worked, which is my concern.

This is the no source package, so I am not changing anything or compiling.

Yes, the advanced tab is enabled.

Back story:
I created the second store on store1.com site because when I created a separate copy of Nopcommerce for store2.com, the CSS file will not load on first call to store2.com. I had to refresh store2.com after I rebooted the server for stoer2 to load properly. Both store1 and store2 were on the same server under the wwwroot, in separate folders of course. After struggling to find the reason for the CSS issue for store2.com, I thought maybe creating a second store on store1.com might resolve the problem. It did. CSS loads fine for both stores now. Then the scheduled tasks stopped working, and the story continues above.

The only problem I have right now but I don't complain about is after every server reboot, both stores will not load, and a 500 server error will show up. So I have to go in the server IIS 10 manager and recycle the application pool and restart the website (store1.com), then the stores will show and work fine.