Forum Discussion
naladar_65658
Altostratus
Jan 21, 2009URI Redirect with complex URI
Hello all,
I have been beating my head up against a wall on this one. I have read numerous posts and have tried out a ton of different methods, but I am just not having any luck on this one.
I am having a problem with a redirect that I am trying to pull off. The iRule syntax checks to be OK, but when I try to run traffic through it I get the dreaded "ERROR_CONNECTION_RESET". I am using HTTP Watch to view the traffic btw.
What I am trying to do is redirect traffic coming in for https://www2.mycompany.com/thewrongnet/pdfsonline/ & the rest of the URI
over to
https://www2.mycompany.com/thenet/ & the rest of the URI
Here is what I have so far, which may be WAY off.
when HTTP_REQUEST {
string tolower[HTTP::uri] starts_with ("/thewrongnet/pdfsonline/") {
redirect to https://www2.mycompany.com/thenet/ + substr(HTTP::uri, 24)
} default {
pool Sharepoint_Pool
}
Thank you all for your time!
2 Replies
- dennypayne
Employee
You're missing an "if", and instead of "redirect to" you need to use the HTTP::redirect command. I would also use "else" instead of "default":when HTTP_REQUEST { if { string tolower[HTTP::uri] starts_with "/thewrongnet/pdfsonline/" } { HTTP::redirect https://www2.mycompany.com/thenet/ + substr(HTTP::uri, 24) } else { pool Sharepoint_Pool } }
- naladar_65658
Altostratus
Thanks!
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