Forum Discussion
ant8344_5401
Nimbostratus
May 04, 2006http redirect rule while preserving the whole URI
Hello,
I have done simple redirects before but have never come across this request (which stumped me).
For instance, we have a redirect from http://www.cnn.com/abc going to http://www.cnn.com/xyz (that is the simple part).
Now we need to be able to preserve the entire URI when performing the redirect, for instance http://www.cnn.com/abc/bla/blaaf./bla.jsp will get redirected to http://www.cnn.com/xyz/bla/blaaf./bla.jsp.
So the path itself will stay the same other than (xyz instead of abc).
Is this at all possible in version 4.5(13), and if so can someone please post an example or shed some light on this matter?
Thanks
5 Replies
- Deb_Allen_18Historic F5 Account
findstr(http_uri, '/abc', 4)
redirect to "https://%h/xyz/(findstr(http_uri, '/abc', 4))"
- Martin_MachacekHistoric F5 AccountWell, the basic idea is good, but syntax is wrong. The correct syntax is:
redirect to "https://" + http_host + /xyz" + findstr(http_uri, "/abc", 4)
- Deb_Allen_18Historic F5 Accountsweet, I figured that wasn't quite right. I forgot you have to isolate the findstr command like that... Thanks for straightening me out.
redirect to "https://" + http_host + "/xyz" + findstr(http_uri, "/abc", 4)
- Bobby_Glidwell_
Nimbostratus
I have a very similar situation and would like to apply a similar fix. However, when I attempt to use a "+" to concantenate strings together, I get an "Error 331835 -- Rule string to tree failed. - syntax error at '+'". - Deb_Allen_18Historic F5 AccountHi Bobby -
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