Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 537237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:54:21+00:00 2026-05-13T09:54:21+00:00

I have a website running on IIS 7 bound to port 80 with 2

  • 0

I have a website running on IIS 7 bound to port 80 with 2 domains (for our purposes – example.com & test.com) pointed at it.

example.com is our canonical name so I would like any client that hits test.com to be redirected to example.com.

I have been trying to use the IIS 7 Rewrite module. However it doesn’t seem to have any effect whatsoever. How can I trouble shoot this?

Here’s the rule I put in my web.config.

<rewrite>
   <rules>
      <rule name="rule1" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
          <match url="*test.com*" />
          <action type="Redirect" url="{R:1}example.com{R:2}" />
      </rule>
   </rules>
</rewrite>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:54:21+00:00Added an answer on May 13, 2026 at 9:54 am

    I was going about it the wrong way. This is the way to do it:

    <rule name="Canonical Host Name" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
         <add input="{HTTP_HOST}" negate="true" pattern="^www\.example\.com$" />
      </conditions>
      <action type="Redirect" url="http://www.example.com/{R:1}" redirectType="Permanent" />
    </rule>
    

    ref: http://blogs.iis.net/ruslany/archive/2009/04/08/10-url-rewriting-tips-and-tricks.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET 4 WebForms website running off IIS 7, we have three
I have a ASP.NET Website (.NET 2 IIS 5.1) running on machine A with
I have a website running on a IIS 7.5 server with ASP.NET 4.0 on
I have a website running on a Windows 2003 server on IIS 6, serving
I have a website running in IIS 6.0, the website is an asp.net with
I have an ASP.NET website which is running currently on IIS. Now I want
I have a C# website running in IIS. I have few .cs files under
I have a website application running in it's own application pool on IIS 7.0.
Here is my problem: I have a website running on IIS 7 + PHP
I have a MVC4/.Net 4 website running on IIS 7.5. In my web.config file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.