Forum Discussion
Vince_Beltz_959
Nimbostratus
Jul 31, 2009Findstr in Redirect?
Seems like this should be very simple. If a certain value is in the HTTP::host, I need to search the URI for a string and do a redirect with the found string on the end of the redirected URI. If the HTTP::host value isn't there, the rule falls through to a standard redirect. Is there a way to simply do the findstr within the redirect, something like this:
when HTTP_REQUEST {
If {[HTTP::host] ends_with "sub.domain.com" } {
HTTP::redirect http://target.com/domain=([findstr] [HTTP::uri] "q=" 2 "&")
else
HTTP::redirect http://target.com/domain=[HTTP::host]
}
- hoolio
Cirrostratus
The rule you posted looks find. Just change the braces slightly:
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