Attached code snippet is working for WebApi application (hosted in IIS 8.5 / 10) but it is not working for sitecore 8.2 application which hosted in same IIS server. Rather always displays Sitecore error page. Any suggestion please?
Additional info more elaborated,
When user hits https://Testing.com/wl/pages/TermsAndCondition, it should redirect to https://Testing.com/TermsAndCondition
It is working with URL Rewrite but with below url
https://Testing.com/TestApp/wl/pages/TermsAndCondition
where TestApp is set as StartItem in SiteDefinition.config but actual end user URL will be the very first one which always redirects to sitecore error page


