Forum Discussion
Galahat_287504
Nimbostratus
10 years agoRewrite incoming PATH
Hi All,
I want to access my app through F5 iRule, let say my url my.example/app1 and i want to access my.example/app1/ping.
When the request coming, how to rewrite /app1/ping become /ping ? because my app don't know the /app1 path. When the request /app1/ping coming, the app can not find the request but if the /ping request coming, the app will response with "pong".
How i can rewrite this ? Thanks for your help.
1 Reply
- Vijay_E
Cirrus
You can do a redirect:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "/app1/" } { HTTP::uri [string map {"/app1/" "/"} [HTTP::uri]] HTTP::respond 301 Location "http://[HTTP::host][HTTP::uri]" } }You can remove the "/app1/" and send the request to the server:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "/app1/" } { HTTP::uri [string map {"/app1/" "/"} [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