I am currently stuck with my rewrite rules, and I would need some hints about it.
Here's the situation : We have two websites, one is website.com, the other one is website-staging.com (just examples here ofc)
On website.com, for some url, I'd like to use a rewrite rule to hit the staging website and display the results.
Here's the rule in the web.config file :
<rule name="RewriteSearchQueries" patternSyntax="Wildcard" stopProcessing="true">
<match url="search?*" />
<action type="Rewrite" url="https://website-staging.com/{R:0}" logRewrittenUrl="true" />
I did the pattern test, everything's ok. The URL used for the rewrite is working properly, however when I hit website-staging.com/search?arg=1&blabla=2, I have a 404 error message :
404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
I did try to put the following action as well :
<action type="Rewrite" url="https://website-staging.com/search?{R:1}" logRewrittenUrl="true" />
And it didn't work either. Any clue ?
EDIT : Application Request Routing is installed, the proxy is enabled.