I'm trying to set up IIS to redirect traffic from https://sub.foo.com
to https://www.foo.com
, but NOT redirecting any traffic to https://sub.foo.com/bar
. The regular HTTP redirect module doesn't allow this kind of control (https://sub.foo.com/bar
will be redirected) so I'm trying to use the URL Rewrite module, but despite much Googling, I can't find the right settings.
Currently my rule looks like this (I don't have the rep to embed images sadly) but isn't working. I've tried setting it at the server level and on both the "to" and "from" sites, but still no luck. What have I missed?