redirect .com to .org

From: Andrew Otto <acotto#gmail.com>
Date: Thu, 30 Apr 2009 16:24:01 -0700


I'd like to use haproxy to redirect all requests of the form *.mydomain.com/* to $1.mydomain.org$2. Basically, I want to translate all mydomain.com URLs to the exact same URL, but replacing .com with .org.

Can I do this using haproxy's redirect feature? I'm having a bit of trouble getting my acls to work right, and I can't find many examples out there. I know I need to define an acl and then use

   redirect prefix http://mydomain.org if url_mydomain_com

If I can get the acl right, then I should able to match whatever I want. redirect prefix allows me to keep the path part the URL string, but how can I keep the host portion of the URL if there is one?

Thanks!
-Andrew Otto Received on 2009/05/01 01:24

This archive was generated by hypermail 2.2.0 : 2009/05/01 01:30 CEST