I'm trying to set up an IIS URL Rewrite function to simply send any URL request to google (as a test):
<rule name="Intercept" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="google-homepage-url-here" appendQueryString="false" logRewrittenUrl="true" />
<conditions>
<add input="{HTTP_HOST}" pattern="example.com$" />
</conditions>
</rule>
I'm using Rewrite rather than Redirect, because I need to hide the URL from the user. The above config works for Redirect but not for Rewrite, why is this?
When I hit http://example.com/blablabla I get a 404.4
My goal is for the user to be directed to the google home page.
I have ARR installed, any ideas?
If you want user to be directed to google home page, you should use redirect, not rewrite. That's not "hiding url from user" but processing on server side.
Without any logs I can only suggest that your IIS is trying to rewrite to google, asks it for some non existent page and obviously returns 404. It can happen if your website uses http and google server uses https, for example.
I think that you should also check difference between redirect and rewrite, this article is a good start.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With