Forum Discussion
RobW
Nimbostratus
Mar 25, 2008302 redirect
High my name is Rob and I'm iRule challenged. I'm running v9.4.4 and I have a 443 virtual server with client side SSL processing. I need to handled 302 status codes differently depending on the returned server port.
The conditions are as follows:
302 port 81 process through https - Currently working using either iRule listed below.
302 port 443 process through https - Currently working using either iRule listed below.
302 port 80 process/redirect via http - Currently not working using either iRule listed below.
HTTP Watch out - 302 redirect port 80
00:00:00.000HTTP 404 Not Found
+ 0.0000.0451491348GET302Redirect to https://www.testurl.com/ports/index.htmlhttps://www.allnewstest.com/suitetest/portal/linkhandler.do?url=http%3A//www.testurl.com/ports/index.html
+ 0.0470.300297588GET404text/htmlhttps://www.testurl.com/ports/index.html
0.34717889362 requests
when HTTP_RESPONSE {
if {([HTTP::status] starts_with "3") and ([TCP::server_port] equals "81")} {
HTTP::header replace Location [string map {http: https:} [HTTP::header value Location]]
}
elseif {([HTTP::status] starts_with "3") and ([TCP::server_port] equals "80")} {
SSL::disable}
}
when HTTP_RESPONSE {
if {([HTTP::status] starts_with "3") and ([TCP::server_port] equals "81")} {
HTTP::header replace Location [string map {http: https:} [HTTP::header value Location]]
}
elseif {([HTTP::status] starts_with "3") and ([TCP::server_port] equals "443")} {
HTTP::header replace Location [string map {https: https:} [HTTP::header value Location]]
}
elseif {([HTTP::status] starts_with "3") and ([TCP::server_port] equals "80")} {
HTTP::header replace Location [string map {http: http:} [HTTP::header value Location]]
}
}
Thanks,
Rob
- RobW
Nimbostratus
Hello, - The_Bhattman
Nimbostratus
[HTTP::uri] is not a valid command under under HTTP_RESPONSE event. - RobW
Nimbostratus
when HTTP_RESPONSE { - The_Bhattman
Nimbostratus
You might want to try to the URI with the HTTP_REQUEST event and then pass that into a variable which can be used within the redirect. - RobW
Nimbostratus
In my case I have an issuse with the way the http profile rewrite matching statement is handling http 302 directs from the servers. So, I have to intercept the GETs for HTTP sites and let the LTM redirect the user.
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