0
votes

Im working on a new website for a customer. The site is hosted in Episerverhosting.com.

They have today public sub-domains such as (example)

  • digital.nor.se
  • customer.nor.se

hosted on wordpress or something.

and the main site:

  • www.nor.se

I need to redirect http://digital.nor.se to www.nor.se/parent/child/granchild

So when we go public and www.nor.se get pointed to our new episerver site i need to check for sub-domain and redirect to pages at the main website.

When i RDP to our server this is how the IIS is configured:

  • only one site in iis named nor.se
  • only one site binding for IP-address *

So as in my understanding the * binding will answer for all request.

Is it possible to use Url Rewrite to set up rules that check for sub-domains and redirect. I tried this:

Using: Regular Expressions

Pattern: (.*)

Conditions:(digitalinsights).nor.episerverhosting.com$

Action type: Redirect

Does not work. Have you an example for a better pattern that check for a specific sub-domain?maybe something like: (digitalinsights).(whatever?) -

I tried this on my local machine. Where instead of * as site binding i added for example digital.nor.local¨ customer.nor.local and added it in the hosts file.

this did work.

But i would like to not add new site bindings on the episerver hosting server.

I would be glad for help.

BR

1

1 Answers

-1
votes

IIS rewrite rules will work for your scenario.

The domain(s) need to point to the web server, and they need to be bound to the IIS instance (either wildcard or explicitly).

There are numerous rewrite examples here.

PS. There's nothing Episerver-specific about this - IIS will redirect the requests before they reach the web app.