redirect all other host headers

Sep 29, 2009 at 9:24 AM

I have a main website in IIS on the domain: http://www.domain.tld
Is it possible to redirect all other host headers configured for this website to: http://www.domain.tld ?

Isapi_Rewrite uses a rule like this to do this:

RewriteCond Host: (?!www\.domain\.tld).*
RewriteCond METHOD GET|HEAD
RewriteRule (.*) http\://www.domain.tld$1 [I,RP] 

Are METHOD, GET and HEAD supported in IIRF?

RvdH

Coordinator
Sep 29, 2009 at 8:06 PM

No, there's no support for HEAD in IIRF.

There is a way to check the METHOD, but you need to do a RewriteCond on %{REQUEST_METHOD}, as you would any server variable.

And likewise if you are doing a conditional on the host, you need to use %{HTTP_HOST}.

Check the doc, it's all in there.