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

  • SEARCH
  • Home
  • 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 7805673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:17:38+00:00 2026-06-02T02:17:38+00:00

I have 1 IIS server that I would like to use to host 2

  • 0

I have 1 IIS server that I would like to use to host 2 different web sites (both on port 80).
I’ve been trying many different combinations (including redirects) and every time, something was breaking (redirect loops, 404, simply not working, etc…)

The rule I think I need goes something like this:

 - match any URL 
 - condition 1: match {HTTP_HOST} to my site URL 
 - condition 2: discard if {REQUEST_URI} is present 
 - action: rewrite URL to /dir1/index.html  

(repeat for site 2)

The problem here seems to be that condition 2 is never true (what should I use to match the absence of {REQUEST_URI}?

Here’s the complete XML:

<rewrite>
    <rules>
        <rule name="RuleForSite1" stopProcessing="true">
            <match url="(.*)" ignoreCase="false" />
            <conditions>
                <add input="{HTTP_HOST}" pattern="^www\.mysite1\.com$" /> 
                <add input="{REQUEST_URI}" pattern=".+" negate="true" /> 
            </conditions>
            <action type="Rewrite" url="dir1/index.html" />
        </rule>
        <rule name="RuleForSite2" stopProcessing="true">
            <match url="(.*)" ignoreCase="false" />
            <conditions>
                <add input="{HTTP_HOST}" pattern="^www\.mysite2\.com$" /> 
                <add input="{REQUEST_URI}" pattern=".+" negate="true" /> 
            </conditions>
            <action type="Rewrite" url="dir2/index.html" />
        </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-06-02T02:17:39+00:00Added an answer on June 2, 2026 at 2:17 am

    I finally figured it out.
    It turns out that {REQUEST_URI} is never actually empty, but contains / when there’s nothing in it.
    I also found that a redirect worked out better.

    This is my final set-up:

    <rewrite>
        <rules>
            <rule name="RuleForSite1" stopProcessing="true">
                <match url="(.*)" ignoreCase="false" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^www\.mysite1\.com$" /> 
                    <add input="{REQUEST_URI}" pattern="^/$"" /> 
                </conditions>
                <action type="Redirect" url="dir1/index.html" />
            </rule>
            <rule name="RuleForSite2" stopProcessing="true">
                <match url="(.*)" ignoreCase="false" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^www\.mysite2\.com$" /> 
                    <add input="{REQUEST_URI}" pattern="^/$"" /> 
                </conditions>
                <action type="Redirect" url="dir2/index.html" />
            </rule>
        </rules>
    </rewrite>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an IIS 6.0 web server that I currently use to serve some
I am a SQL Server DBA and have a database that I would like
I have a server-side zip archive that I would like to pass along as
I'm building an application that needs to use a web server like a file
I have two asp.net applications on one IIS server and I would like to
I have an iis server on a windows 2003 production machine that will not
Can someone explain how the ASP.NET Web Development Server work? I don't have IIS
I have recently configured IIS 7.5 to use the SMTP server. Now, I have
I have a web form on an IIS server (has no PHP). I have
I have a web application that runs perfectly fine when I use the Visual

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.