Hi @Abid Zafar ,
You can try this rule:
appcmd.exe set config -section:system.webServer/rewrite/globalRules /+"[name='arr_to_serverfarm',patternSyntax='Wildcard',stopProcessing='True']" /commit:apphost
appcmd.exe set config -section:system.webServer/rewrite/globalRules /[name='arr_to_serverfarm',patternSyntax='Wildcard',stopProcessing='True'].match.url:"*" /commit:apphost
appcmd.exe set config -section:system.webServer/rewrite/globalRules /[name='arr_to_serverfarm',patternSyntax='Wildcard',stopProcessing='True'].action.type:"Rewrite" /[name='arr_to_serverfarm',patternSyntax='Wildcard',stopProcessing='True'].action.url:"http://myServerFarm/{R:0}" /commit:apphost
Or combine them to a command line:
appcmd.exe set config -section:system.webServer/rewrite/globalRules /+"[name='arr_to_serverfarm',patternSyntax='Wildcard',stopProcessing='True']" /[name='arr_to_serverfarm',patternSyntax='Wildcard',stopProcessing='True'].match.url:"*" /[name='arr_to_serverfarm',patternSyntax='Wildcard',stopProcessing='True'].action.type:"Rewrite" /[name='arr_to_serverfarm',patternSyntax='Wildcard',stopProcessing='True'].action.url:"http://myServerFarm/{R:0}" /commit:apphost
I have tested them and they can work well.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Bruce Zhang