IIS URL Rewrite Module : Redirect Based On QueryString

前端 未结 2 1503
悲&欢浪女
悲&欢浪女 2020-12-24 12:16

I Have some problems with redirecting to another URL based on the query string parameters. I want to redirect users which enter www.domain.com/signup.aspx?p=1 to:

w

2条回答
  •  伪装坚强ぢ
    2020-12-24 13:21

    A more robust method of using a value to select a destination is to use Rewrite Maps. The map is essentially a lookup table. This doesn't require a new rule (and an additional evaluation of the URL against a pattern on every request) for every new path.

    
      
        
        
          
          
        
        
      
    
    
      
        
        
        
        
      
    
    

    Definitions:

    • {C:1} is a backreference to the first condition match: the query string value.
    • {Signups:{C:1}} is an instruction to look up {C:1} in the Signups map.
    • {C:2} is a backreference to the second condition match: the value from the Signups map.

提交回复
热议问题