URL Redirect/Rewrite when opened from Mobile Browser

后端 未结 2 1741
刺人心
刺人心 2021-01-14 00:14

We are working on two website, where one is webapplication and another is mobile application.

So my requirement is to create a redirection url to redirect from webap

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-14 00:40

    You can use the {HTTP_USER_AGENT} condition to do this.
    Applied to your case, it would be as follow:

    
        
        
            
            
            
        
        
    
    

    It will match exactely home/Account/ and if the user is browsing from a mobile device, he/she will be redirected to http://m.testresponce.com/mforyourhome/Account.aspx

    Important

    Apply this rule on http://testrequest.com/ only (or at least avoid being stuck in an infinite redirect).
    User agent are never 100% reliable (since they can be changed)

    Source: http://forums.iis.net/t/1169853.aspx

提交回复
热议问题