Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

How can I redirect to using DNS / IIS? I wish to do this for an web site to prevent duplicate contents (Bad for SEO).

I had 2 a record in dns (Windows Server 2008) for and

Also in IIS I added and in edit bindings.

Which changes should I do in my IIS and DNS to redirect to

Should I change the web.config file in my project?

share|improve this question

migrated from Sep 7 '11 at 14:47

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 5 down vote accepted

The easiest way is to set up another site for the one you want to redirect in IIS. You then configure that site to be a redirection to the other one.

See here for details on setting up the redirect

to install http redirection

  1. Click Start, click All Programs, Click Administrative Tools, Click Server Manager
  2. Expand Roles in the left bar, and click Web Server (IIS)
  3. In the main window, click Add Role Services
  4. In the Common HTTP Features, check HTTP Redirect and then click Install

both DNS entries need to point at your server, so that clients know how to get to either one. Remove the binding for from your original site. Add a new site bound to, and make this redirect to

share|improve this answer
really thanks for answer / Http Redirection role not always installed in IIS 7.0 -> how can i install it ? / also which part of my iis or dns should i remove or change? – LostLord Sep 6 '11 at 22:36

In IIS, you can add a second host header in the Bindings section of a web application, so the same web application can answer and This assumes that you don't care which URL is displayed in the browser address bar. A single entry in the DNS table for should suffice in this case.

In this case HTTPS binding for both domain names can not be applied.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.