Forum Discussion
George_72275
Jun 08, 2012Nimbostratus
How to mask URL
Hi there,
I'm new to iRules and trying to come up with a solution here and hoping someone can help. I have two URLs:
1) http://www.abc.com/join
2) http://www.abc.com/join/events
I would like the 2nd one to stay http://www.abc.com/join/events in the URL bar when the user types it but redirect behind the scenes to http://www.abc.com/join
Is that possible?
Thanks,
George
- Richard__HarlanHistoric F5 AccountThe following should work for you
- George_72275NimbostratusUnfortunately that did not work as I receive the following 404 error:
- That's because the iRule is comparing the string "/join/events" and you passed in "/join/events/".
when HTTP_REQUEST { if { [HTTP::uri] equals "/join/events/" } { HTTP::uri "/join" } }
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/join/events" } { HTTP::uri "/join" } }
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/join/events" - "/join/events/" { HTTP::uri "/join" } } }
- George_72275NimbostratusMany thanks Joe!
- George_72275NimbostratusThe customer has now changed the requirements.
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