Forum Discussion
TheManu
Nimbostratus
Nov 12, 2007data gets lost when URL redirect
I want to implement a URL redirect for the following URL:
https://test.company.com/branch/workinggroup
Destination is:
https://test.company.com/programs/logic.php
The purpose of this page is that a user may post XML data, which is put into the body of the page. The PHP file contains the logic to read this data and automatically create an order in our system.
When I use the following URL redirection, the request is the redirected but the data gets lost:
when HTTP_REQUEST { if { [HTTP::host] eq "test.company.com/branch/workinggroup"}{ HTTP::header replace "host" "test.company.com/programs/logic.php"}}
Does anyone know how to change the iRule to keep the order process working?
Thanks for your help.
- hoolio
Cirrostratus
Hi,when HTTP_REQUEST { if { [HTTP::host] eq "test.company.com"}{ log local0. "Rewriting client request for host: [HTTP::header value Host], for URI: [HTTP::uri]" HTTP::header replace "host" "test.company.com" HTTP::uri "/programs/logic.php" } }
- TheManu
Nimbostratus
Thank you for reply.when HTTP_REQUEST { if { [HTTP::host] eq "test.company.com"}{ log local0. "Rewriting client request for host: [HTTP::header value Host], for URI: [HTTP::uri]" HTTP::header replace "host" "test.company.com" HTTP::uri "/programs/logic.php" } }
when HTTP_REQUEST { if { [HTTP::host] eq "test.company.com/branch1/workinggroup"}{ log local0. "Rewriting client request for host: [HTTP::header value Host], for URI: [HTTP::uri]" HTTP::header replace "host" "test.company.com" HTTP::uri "/programs/logic1.php" } }
when HTTP_REQUEST { if { [HTTP::host] eq "test.company.com/branch2/workinggroup"}{ log local0. "Rewriting client request for host: [HTTP::header value Host], for URI: [HTTP::uri]" HTTP::header replace "host" "test.company.com" HTTP::uri "/programs/logic2.php" } }
- hoolio
Cirrostratus
Do you actually expect Host header values other than test.company.com? Assuming not, you could try this to verify the URI matches for the rewrite:when HTTP_REQUEST { check if the path of the request starts with "/branch1/workinggroup" if {[HTTP::path] starts_with "/branch1/workinggroup"}{ HTTP::header replace "Host" "test.company.com" HTTP::uri "/programs/logic1.php" check if the path of the request starts with "/branch2/workinggroup" } elseif }{[HTTP::path] starts_with "/branch2/workinggroup"}{ HTTP::header replace "Host" "test.company.com" HTTP::uri "/programs/logic2.php" } }
- TheManu
Nimbostratus
Hi Aaron, - TheManu
Nimbostratus
Me again,
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