Dan44
Nov 22, 2019Altostratus
URL Rewriting
Hello together
Does anyone have experience with URL rewriting wit help of an iRule or a rewrite profile?
For a migration i have to rewrite a url. We have two pools (old-web, new-web) containing IIS web servers.
The url like:
https://www.myweb.com/webapp/v40/typ?filter=typ%3D10 should be rewritet to https://app.myweb.com/v40/typ?filter=typ%3D10
The problem is that app.myweb.com does't expect webbapp in the path, therefore it must be sent without /webapp/ to the host.
i first tried it with an irule, this does not work unfortunately
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] starts_with "www.myweb.com" && [string tolower[HTTP::path]] eq "/webapp/"} {
HTTP::header replace Host "app.myweb.com"
HTTP::uri "/"
pool new-web 80
}
}
Then i tried it with an rewrite profile
Does anyone have any idea what I'm doing wrong?