Skip to main content Skip to footer

How to assign multiple hostnames or IP addresses

Any live website should only be served via a single domain. Any other domains (e.g. my-website.com or mywebsite.co.uk) you own that are pointing to your website should redirect to a single domain. This is very important for SEO as each domain is seen as a unique site by google so the more domains you have pointing to a site without a redirect to the main domain will negatively affect your SEO.

Step 1

Add your redirect rules to the web.config file of your website. In the following example, mywebsite.com is the main domain of your website.

<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to main domain" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="www.mywebsite.com" />
<add input="{HTTP_HOST}" pattern="www.my-website.com" />
<add input="{HTTP_HOST}" pattern="my-website.com" />
</conditions>
<action type="Redirect" url="http://mywebsite.com/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>

 

Step 2

If your website is served via https, change the action type above to:

<action type="Redirect" url="https://mywebsite.com/{R:0}" />

And then add the following rule:

<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
</rule>

 

Step 3

If your secure certificate has been assigned an IP address which can be directly used to access your website, you will also need to add the unique IP address assigned to your secure certificate to your conditions group.

<add input="{HTTP_HOST}" pattern="YOUR IP ADDRESS" />

Using this approach your website will always be served via mywebsite.com no matter what domains or IP addresses are pointing to your website and your uSkinned domain license will always work.

#h5yr

Step 1

Sign up

Start a free trial of Site Builder.

Step 2

Design

Tailor the look and feel with the Visual Designer to suit your brand.

Step 3

Create

Add content with built-in eCommerce and third-party integrations.

Step 4

Go Live

You can host on Azure with us or choose your own with the self-hosted license.