Forum Discussion
paul_dcc
Nimbostratus
Jun 24, 2014Can't get my redirect to work !!!
Hi All,
I'm trying to get my redirect to work and I'm have some problems, can some one put me right please.
when HTTP_REQUEST {
if { [HTTP::uri] equals "https://test.geowessex.com" } {
HTTP::r...
Jun 24, 2014
Hi Paul
Strange.
Try this rule instead?
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if { $host equals "https://test.geowessex.com" } {
HTTP::redirect "https://test.geowessex.com/geoserver/"}
elseif { $host equals "https://test2.geowessex.com" } {
HTTP::redirect "https://vmcrgifme1"
}
}
If that does not work, try adding log section to see what the hosts header contains.
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
log local0. $host
if { $host equals "https://test.geowessex.com" } {
HTTP::redirect "https://test.geowessex.com/geoserver/"}
elseif { $host equals "https://test2.geowessex.com" } {
HTTP::redirect "https://vmcrgifme1"
}
}
Then check the result in the /var/log/ltm log.
/Patrik
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