Forum Discussion
silver
Nimbostratus
Sep 26, 2012URI Rewrite
HI All,
I have a specific requirement to rewrite the URI when the user requests the URL and the change has to be made interanlly without knowing to the external user.
Original URL : https://www.abc.com/customer/context/html need to be changed internally as below
https://abc.com/testcustomer/testcontext/html
Can anyone help me by providing an iRule matching the above.
Thanks in advance.
14 Replies
- silver
Nimbostratus
Hi Mike,
Basically i need a change only in the context path.
https://abc.com/testcustomer/testcontext/html need to internally rewritten as
https://abc.com/customer/context/html
So the context testcustomer should be replaced by customer and testcontext to be replaced as context for all the incoming requests and the end user should not see any change in browser. - nathe
Cirrocumulus
Is this possibly the trailing slash issue?
What happens if you browse to
https://abc.com/testcustomer/testcontext/html/ ?
Just a thought. You may need to slightly amend your irule logic too.
N - silver
Nimbostratus
no difference.
receiving the same output and not working. :-( - Michael_Yates
Nimbostratus
Hi Silver,
Try this:when HTTP_REQUEST { if { ( [string tolower [HTTP::uri]] contains "/testcustomer" ) or ( [string tolower [HTTP::uri]] contains "/testcontext" ) } { HTTP::uri [string map {"/testcustomer" "/customer" "/testcontext" "/context"} [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