Forum Discussion
OliverS_221234
Nimbostratus
Sep 21, 2015Redirect URL with URL attached
Hi,
I'm new to F5 and have a question regarding URL redirect. The task is to change the server URL but leave the URL path untouched. An example would be:
redirect www.company.de/abc/xyz/ to...
Stanislas_Piro2
Cumulonimbus
Sep 21, 2015Hi,
When requesting www.company.de/abc/xyz/ the HTTP request is:
GET /abc/xyz/?param1=value1¶m2=value2 HTTP/1.1
Host: www.company.de
User-agent: Mozilla...
Other-Headers
When working with HTTP:
- www.company.de is HTTP Host : variable [HTTP:host]
- /abc/xyz/?param1=value1¶m2=value2 is the uri : variable [HTTP:uri]
- /abc/xyz/ is the path : variable [HTTP:path]
- param1=value1¶m2=value2 is the query string : variable [HTTP:query]
Try the following irule:
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "some.company.de"} {
HTTP::redirect "https://some.company.com[HTTP::uri]"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects