301 redirect for www and non-www canonical problems

698 Views Asked by At

i have a web site on a Microsoft IIS Web Server and my web site consists of simple static HTML pages.

I need to solve my canonical problems as the following are all valid for my page:

http://www.nurcanaral.com
http://nurcanaral.com

I want all of the above addresses to be redirected to www only. All the searches I've done give me .htaccess solutions for Apache servers. But this is not valid for my server. I don't have much experience with server coding. Is there a way to achieve the above solution within the page code itself?

1

There are 1 best solutions below

0
On

I usually create two websites in IIS for each site. For example:

First Site: Name: nurcanaral Bindings: www.nurcanaral.com:80

Second Site: Name: nurcanaral-www Bindings: nurcanaral.com:80

For the second site, you will need to configure HTTP Redirect options as shown in image below.

https://i.stack.imgur.com/CfaSE.jpg