Rewrite the ASP.Net MVC homepage to a different IP address

I am trying to rewrite my homepage to a different IP address in my ASP.Net MVC application. I installed the URL and application routing modules in IIS. I set the rewrite to my web.config, when I change the type of action to redirect, it works fine, but as soon as I change it to rewrite it, it doesn't work at all. I changed the corresponding URL to accept all requests, but still it does not work.

<system.webServer>
        <rewrite>
        <rules>
        <clear />
         <rule name="node" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
           <match url="*" />
           <action type="Rewrite" url="http://255.255.255.255/" />
         </rule>
       </rules>
     </rewrite>
  </system.webServer>

The rewrite process seems to have some routing conflicts. How can I make the rewrite priority higher?

+4
source share
3 answers

URL- <rewrite> URL- IP- :

IIS.NET: Rewrite URL . URL ( , contoso/test/default.aspx).

, , URL, . IIS, HttpHandler, . http://urlrewriter.codeplex.com

+1

Will there be inheritance of configs? If so, you can wrap the desired section with <location> to disconnect inheritance from the parent application ...

<location path="." inheritInChildApplications="false">
  <system.webServer>
    ...
  </system.webServer>
</location>
0
source

Source: https://habr.com/ru/post/1649189/


All Articles