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
...
hoolio
Cirrostratus
Nov 12, 2007Do 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"
}
}If you do want to validate the Host header equals "test.company.com" you could wrap the path checks in an 'if'.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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