Forum Discussion
N__197982
Nimbostratus
Jul 16, 2018iRule for redirection with masking for a specific URI only.
Folks,
We received some redirect requests for a very particular scenario and based on that I have come up with a iRule which I want to get some additional comments on:
The redirect requests...
Leonardo_Souza
Cirrocumulus
Jul 16, 2018Have a look at this answer:
https://devcentral.f5.com/questions/uri-translation-vs-httpredirect-irule-52327
I modified your iRule, you will have to test:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/manual/" } {
HTTP::header replace "Host" "www.newsite.com"
set uri [string range [HTTP::uri] 8 end]
HTTP::uri "/support/txt/docs/$uri"
}
}
The logic is correct, but you had multiple syntax errors. Also, you need to send the remaining of the URI to the server.
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