My production web environment contains two clustered servers. I need to redirect any direct requests to the two nodes to the main www URL. I also need to make sure my non-www redirect (with ISAPI_Rewrite) remains in tact. So essentially, I need:
domain.com -> www.domain.com node1.domain.com -> www.domain.com node2.domain.com -> www.domain.com
Here is my current RewriteRule:
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^domain\.com(.*) [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.domain.com%3 [R=301,L]
I know there is a solution here using IIS, ISAPI_Rewrite, or some combination of both, but I haven't been able to find it.