简体   繁体   中英

URL Rewrite to external website not working on IIS 8.5 but works on IIS 7.5

<rule name="Reverse Proxy to externalwebsite.com" stopProcessing="true">
  <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  </conditions>
  <match url="/(.*).cgi" />
  <action type="Rewrite" url="http://externalwebsite.com/cgi_bin/{R:0}" logRewrittenUrl="true" />
  <serverVariables>
    <set name="HTTP_REFERER" value="http://externalwebsite.com" />
  </serverVariables>
</rule>

Basically, I want to rewrite all request for internalwebsite.com/cgi_bin/*.cgi to externalwebsite.com/cgi_bin/*.cgi

Above rule works perfectly on a windows 7 system with IIS7.5 version. But it doesn't work on a windows 8.1 system with IIS8.5. It gives generic 404.4 error.

I've made sure that URL Rewrite module and Application Request Routing module is installed on both systems. Any guesses on what can be wrong?

I had missed a silly thing.

Make sure that root node is selected. Application Request Routing > Server Proxy Settings (right pane) > Enable > Apply.

That's it. This is also required on Windows 7 and IIS 7.5. I had done that and forgot to do the same on IIS8.5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM