Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Migrate Apache RewriteRule to haproxy http-request redirect

$
0
0

@ARadauer wrote:

We have a lot RewriteRules in our Apache config files. Now we have to migrate these rules to haproxy.

For Example:

RewriteCond %{HTTP_HOST} ^app.mydomain. com*
RewriteRule ^/$ app.mydomain. com/app/startpath [R,L]

How could this be configured in haproxy? like this?

http-request redirect code 302 location https://app.mydomain. com/appPath if { path / and url_dom app.mydomain. com }

Can I use values from a regex expression in the location?

We have a lot of these rules:

RewriteRule ^/?products/(detail|edit)/(\S+)$ /p?$1=$2 [R=301,L]

where app.mydomain. com/products/detail/123 redirects to app.mydomain. com/p?detail=123

Can this be done in haproxy?

Thank you for your help

(the blank before the .com is because i’m getting the message “Sorry, new users can only put 2 links in a post.”)

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>