Forum Discussion
roger10dc_46053
Nimbostratus
Sep 17, 2010URI Rewrite
Hi,
How can I redirect a URI from:
http://www.xyz.com/something/howto.hml
to
http://www.xyz.com/somethingX/howto.hml
Jon
- Chris_Miller
Altostratus
Are you trying to send a redirect to the user or are you trying to rewrite the uri between the LTM and server while maintaining the original URI in the browser? - roger10dc_46053
Nimbostratus
Hi, to the user is fine. - roger10dc_46053
Nimbostratus
Hi, to the user is fine. - Chris_Miller
Altostratus
Is it for that exact string? or do you want to add an "X" to a certain part of the URI.when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "www.xyz.com" and [string tolower [HTTP::uri]] eq "/something/howto.html" } { HTTP::redirect "http://www.xyz.com/somethingX/howto.html" } }
- roger10dc_46053
Nimbostratus
Hi, - roger10dc_46053
Nimbostratus
So far I am up to here, no errors, but does not work. - Chris_Miller
Altostratus
By using "string tolower," you're automatically converting the host and URI to lower case. Since your "eq" statement compares it to "Citrix" and "XenApp" which contain upper case characters, you'll never match.when HTTP_REQUEST { if {[class match [IP::client_addr] eq internal_net] and [string tolower [HTTP::host]] eq "www.csg.xyz.com" and [string tolower [HTTP::uri]] starts_with "/citrix/xenapp/" } { HTTP::redirect "https://csg.xyz.com/citrix/xenapp1/" } }
- roger10dc_46053
Nimbostratus
Hi Chris, - roger10dc_46053
Nimbostratus
It's working, that's awesome, thank you!!!
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