We are moving to a new domain and need to redirect users from the original to the new domain.

One of the things I need to do is have it set up so if a user has a saved link such as www.domain.com/questions it redirects to www.newdomain.com/questions.

We have multiple links that need to be redirected for SEO purposes. Apparently you can do this in apache using the htaccess file with the below code,

RewriteCond %{HTTP_HOST} ^DomainA.com
RewriteRule ^(.*) http://DomainB.com/$1 [P]

My question is how can I achieve this using the web.config file in IIS or redirection.config?


I found the solution to the issue. you can actually use for for a bunch of stuff

<rule name="OriginalDomainRedirection">
      <action type="Redirect" url="https://www.domain.com/{R:0}" redirectType="Permanent" />

This if put in the wqeb.config file will redirect any page on domain A to the same page on Domain B. Works great for SEO.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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