Forum Discussion
URI Rewrite Help - Rookie
Hi,
You can do the following :
when HTTP_REQUEST {
if { !([HTTP::path] starts_with "/broker/api/public") } {
HTTP::respond 302 Location "/broker/api/public[HTTP::uri]"
}
}
- Tim_Cahoon_1608Jul 28, 2016
Nimbostratus
Thank you Yann. that is doing what I need. One last question, is there a what to not let the client see the rewritten URI? I'd like them to see what they sent, and have the rewritten go to the server only. Any ideas on this?
Once again thank you.
- Yann_Desmarest_Jul 28, 2016
Nacreous
Hi,
The irule previously posted do a redirect on the client side. If you require to do URI rewriting, you will need to change the irule :
when HTTP_REQUEST { if { !([HTTP::path] starts_with "/broker/api/public") } { HTTP::uri "/broker/api/public[HTTP::uri]" } }You may also have a look at the URI rewrite profile that has the advantage to rewrite response headers and payload to remove "/broker/api/public" for the client.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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