Rewrite URL from one domain to another


I need to completely rewrite to replace the URL * and I haven’t been able to figure this out yet. The Apache example I’ve been given is this:

RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^/(.*)$$1 [P,L]

I really need to have a path on as well.
RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^/(.*)$$1 [P,L]

Anyone have any ideas?


not tested, but should be something like

http-request set-var(txn.host_header) req.hdr(Host),lower
acl is_domain1 var(txn.host_header) -m beg
http-request set-header Host if is_domain1
http-request set-uri  /pathtoapp/%[capture.req.uri] if is_domain1


Good luck