0

I am experiencing an issue with the IIS Rewrite Module and nopCommerce.

Situation:

I have several domains (Domain1.ca, Domain2.ca, etc.), each redirecting to a main domain (MainDomain.ca) at the Registrar level (using a CNAME record). Is it possible, using the IIS 8 Rewrite module, to retain the original HTTP_HOST value of the domain originally browsed to (Domain1.ca, Domain2.ca, etc.) instead of the redirected domain (MainDomain.ca)? I need this for the following reason:

In nopCommerce, each store corresponds to a unique domain (Store1 = Domain1.ca). To determine which store is active, nopCommerce obtains and resolves the "HTTP_HOST" value.

Unfortunately, since all domains get redirected to the main domain (MainDomain.ca), the original HTTP_HOST value (Domain1.ca) is lost. Therefore, not knowing which specific store needs to get activated, nopCommerce activates the first one in the list.

I assume that when a site has been redirected to, the original HTTP_HOST value is overwritten.

Does anyone have any experience with nopCommerce, HTTP_HOST, multi-store, domain redirection?

Rafael
  • 2,827
  • 1
  • 16
  • 17

1 Answers1

0

a CNAME does not perform any redirection. A CNAME simply says that domain1.com will us ethe same dns records as domain2.com, aka it is an alias.

So if you are really are redirecting from your domain registrar then you are not using a CNAME record to do this. You must be using a REDIRECT service at the registrar, the most common one is an FRAME redirect, where they create a website for domain1.com and inside they put a frameset which points to domain2.com

I would suggest that remove this, and just use the CNAME only and then do the redirect at your webserver using URL REWRITE, this will then allow you to retain the original host name.

snake
  • 732
  • 1
  • 6
  • 11
  • Hi Snake, Thanks for helping with the answer. Still confused though. Here is a snippet from the manual: From the control panel of www.store2.com (Meaning, your hosting control panel, not nopCommerce Administration area) ensure that all requests to www.store2.com are forwarded (not redirected) to www.store1.com . Perform this using CNAME records. This step is crucial. – Giovanni Palmiotto Sep 02 '13 at 18:53
  • It is neither forwarding or redirecting, as I said a cname is just an alias to the domain you are using in the cname record. You need to setup a host header for both fomains on your site Iin iis and then use url rewriting to redorect domsin1 to domain2 – snake Sep 02 '13 at 22:39