asp.net mvc - Need Port redirection pattern for IIS Windows -
i have application running under http://localhost/testapp inside i'm making ajax call node.js app running under port 3000 i.e. http://localhost:3000
now want configure iis whenever request comes http://localhost/node wanted redirect http://localhost:3000/ example: if make request url http://localhost/node/sample want handled server redirect request http://localhost:3000/sample
i tried .net installer url rewrite , tried config pattern didn't work me. guys please me out?
my index.cshtml
@{     viewbag.title = "index"; }  <h2>this index page</h2>  <script>     $(function () {         $.ajax({             url: "/node/sample",             success: function () {                 alert('done');             }         });     }); </script> error i'm getting below..
url redirection not happening , throws resource not found exception
try out:
<rewrite>   <rules>     <rule name="redirectto3000" patternsyntax="ecmascript" stopprocessing="true">       <match url="/node/(.*)" />                 <conditions>                     <add input="{http_host}" pattern="/node/([a-z]+)" />       </conditions>       <action type="redirect" url="http://localhost:3000/{r:1}" redirecttype="permanent" />     </rule>   </rules> </rewrite> this should work...
Comments
Post a Comment