title: HAProxy Redirect URL
body: <p>I am using HAProxy 1.8, I need to make redirection rules, but I do not know the tool well, I have tried but it fails me in some particular cases with different clients.</p>
  
  <p><strong>Client Applications</strong>: <em>Adobe Flex 3 (Web) and .Net (Web, WebServices and Desktop)</em>.</p>
  
  <p>Necessary redirection example:</p>
  
  <p><strong>Current URL</strong>: <a href="http://oldsite.com/WS/WSInfo/WSDataClient" rel="nofollow noreferrer">http://oldsite.com/WS/WSInfo/WSDataClient</a></p>
  
  <p><strong>URL redirection</strong>: <a href="http://web1.site.com/WS/WSInfo/WSDataClient" rel="nofollow noreferrer">http://web1.site.com/WS/WSInfo/WSDataClient</a></p>
  
  <p>I must perform several redirects (so I have to repeat the rule many times), I can not redirect all "<strong><em>olsite.com</em></strong>" to "<strong><em>web1.site.com</em></strong>", since both balancers will have concurrent calls, not all services, <em>"<a href="http://oldsite.com" rel="nofollow noreferrer">http://oldsite.com</a></em>" will stop being used.</p>
  
  <p><strong>The rule of HAProxy</strong>:</p>
  
  <pre><code>###----SERV_WSInfo_WSDataClient_test
  acl withwsdl_SERV_WSInfo_WSDataClient url /WS/WSInfo/WSDataClient_test?wsdl
  acl notwsdl_SERV_WSInfo_WSDataClient path_beg  /WS/WSInfo/WSDataClient_test 
  
  http-request redirect location http://web1.site.com/WS/WSInfo/WSDataClient?%[query] code 301 if withwsdl_SERV_WSInfo_WSDataClient  
  http-request redirect location http://web1.site.com/WS/WSInfo/WSDataClient code 301 if notwsdl_SERV_WSInfo_WSDataClient
  </code></pre>
  
  <p>This works in the Flex applications that consume it, but not in the .Net point, I have been able to detect that:</p>
  
  <p>Flex calls WSDL twice from the service (I suspect that by the redirect of the rule), but it works.
  .Net, on the other hand, never asks for the WSDL and the service returns error, blank response.</p>
  
  <ol>
  <li>Someone can recommend how would be the correct way to implement the
  rule to achieve the necessary redirection. </li>
  <li><p>To redirect an HTTPS with that same URL, should I add more logic?</p></li>
  <li><p>They think that I'm not using the necessary tool to do it, they can recommend another one (currently HAProxy is used but if I manage to make it work in another Proxy, I could ask to evaluate).</p></li>
  </ol>
  
  <p>I thank you for your help since I do not use the tool and I am not from the network area.</p>