Forum Discussion
URI removal from the hostname
A customer provided a server and pool to sit behind the LTM. He's asked that when users connect to the FQDN, that they're directed to a specific location on the server.
Client-side UA connects to https://dev.domain.com/ Server-side, F5 sends to devserver1.company.com/unwanteduri
I put in the following iRule, which hides the URI from the browser :
when HTTP_REQUEST {
if { ([HTTP::host] == "dev.domain.com") and ([HTTP::uri] == "/") } {
HTTP::uri "/unwanteduri/"
}
}
The page connects and loads, but I'm getting 404s on the server side because the /unwanteduri/ is being removed from the server-side requests.
Should this be done with a stream profile, or can it be completed within just the iRule?
Hi,
You can use the Stream profile but you may see some unexpected rewrite.
Alternatively, you can apply an empty stream profile to the Virtual Server and write an irule that rewrite specific content types (txt, css, js, json)
The following irule can do the job for you : HTTPS offload rewriting
- Stanislas_Piro2
Cumulonimbus
Hi,
can you explain what is expected!
if you want to rewrite
- https://dev.domain.com/ to https://devserver1.company.com/unwanteduri/
- https://dev.domain.com/anotherpath to https://devserver1.company.com/unwanteduri/anotherpath
you can use a rewrite profile translation mode with a rule
- direction both
- client URL : https://dev.domain.com/
- Server URL : https://devserver1.company.com/unwanteduri/
no need to use stream profile.
Recent Discussions
Related Content
* 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