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 6628507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:08:22+00:00 2026-05-25T22:08:22+00:00

I am using ISAPI-Rewrite on IIS7. How can we combine [NC] and [OR] in

  • 0

I am using ISAPI-Rewrite on IIS7.
How can we combine [NC] and [OR] in a RewriteCond ? [NC,OR] ?
What is the simple way to match domains with and without “www.” ?

Here is a draft :

RewriteCond %{HTTP_HOST} ^old-one.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.old-one.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^old-two.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.old-two.com$ [NC]
RewriteRule ^(.*)$ http://www.new-website.com/$1 [QSA,L,R=301]
  • 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-25T22:08:22+00:00Added an answer on May 25, 2026 at 10:08 pm

    Yes, [NC,OR] is the way of combining those two flags.

    To combine multiple similar conditions into one, try this one:

    RewriteCond %{HTTP_HOST} ^(old-one\.com|www\.old-one\.com|old-two\.com|www\.old-two\.com)$ [NC]
    RewriteRule .* http://www.new-website.com%{REQUEST_URI} [L,R=301]
    

    P.S.
    Since you are on IIS 7, why not use their native rewriting engine (URL Rewrite module) — yes, it has different syntax (not .Apache’s .htaccess, but standard web.config XML file) but does work fine (no performance issues here on my servers).

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

Sidebar

Related Questions

I'm using Isapi Rewrite 3 (mod rewrite clone for IIS) and trying to rewrite
I'm using Helicon's ISAPI Rewrite 3 , which basically enables .htaccess in IIS. I
I am using IIRF - an ISAPI rewrite filter for pretty URL's. I haven't
I want to implement an ISAPI filter like feature using HttpModule in IIS7 running
I'm currently using ISAPI Rewrite I'd interesting in moving my ColdFusion app to Apache
In WIX, I can install an ISAPI filter using the iis:WebFilter element: <Component Id='C.Filter1'
In IIS6 was there a reason for using ISAPI filters/ extensions?. Can the same
I am using ionics isapi rewrite filter to redirect all .asp files to validate.asp
I have a simple rewrite rule that writes to an external domain using the
I've been using ISAPI_Rewrite from Helicon ( http://www.helicontech.com/isapi_rewrite/ ) on a Server 2003 box

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.