c# - Web.config URL Rewrite -


I would like to rewrite all those files which are real files or actual directories, and / api / * < / Code> to ~ / Default.aspx .

This is what I have done so far:

   & Lt; Conditions & gt; & Lt; Input = "{REQUEST_FILENAME}" matchType = "IsFile" reject = "true" /> & Lt; Input = "{REQUEST_FILENAME}" matchType = "isDirectory" reject = "true" /> & Lt; / Status & gt; & Lt; Action type = "rewrite" url = "Default.aspx" /> & Lt; / Rules & gt; & Lt; / Rules & gt; The problem with this is that it also rewrites  / api / *  as  default.aspx .   

Try adding the following condition:

  & lt; Condition & gt; & Lt; Input = "{REQUEST_FILENAME}" matchType = "IsFile" reject = "true" /> & Lt; Input = "{REQUEST_FILENAME}" matchType = "isDirectory" reject = "true" /> & Lt; Input = "{URL}" Reject = "true" pattern = "(?: \ / Api)" /> & Lt; / Status & gt;    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -