Forum Discussion
DaveC_53879
Nimbostratus
Jul 29, 2011Inserting 301 returns blank page
The rule below returns a 301 but it also returns a blank page, so somehow my redirect to "http://synergycitizens.org[HTTP::uri]" isn't working. The host names below are not real, but the rule below accurately reflects my existing rule. What am I missing here? Thanks.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"www." -
"synergycitizens.net" -
"synergycitizens.com" -
"synergycitizens.mobi" -
"synergycitizens.net" -
"citizensforsynergy.org" -
"citizensforsynergy.net" -
"citizensforsynergy.com" -
"synergyscitizen.org" -
"synergyscitizen.com" -
"synergycitizen.net" -
"synergycitizen.com" -
"synergy-citizen.org" -
"synergy-citizen.net" -
"synergy-citizen.com" -
"synergy-citizens.org" -
"synergy-citizens.net" -
"synergy-citizens.com" -
"synergycitizen.org" { HTTP::respond 301 "http://synergycitizens.org[HTTP::uri]" }
}
}
15 Replies
- Peter_72728
Nimbostratus
Looks to me like your 301 response is missing a very important header...
Example from my testing...
HTTP/1.0 301 Moved Permanently
Location: http://www.test.com/index.html
Server: BigIP
Connection: Keep-Alive
Content-Length: 0 - DaveC_53879
Nimbostratus
Any idea why or how to fix it? - DaveC_53879
Nimbostratus
Aaron and Peter, I found the problem. I inserted the word "Location" after the 301. That works. Thanks for all your help. I really apreciate it. I wouldn't have gotten this far without it.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"www.*" {
HTTP::respond 301 Location "http://ddcpoc.com[HTTP::uri]"
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting to http://ddcpoc.com[HTTP::uri]"
}
default {
log local0. "[IP::client_addr]:[TCP::client_port]: Doing nothing for [HTTP::host][HTTP::uri]"
}
}
} - Peter_72728
Nimbostratus
Sorry, Dave. I didn't notice the omission of "Location" until you pointed it out. Now it's so obvious! Glad to hear you've got it working. - hoolio
Cirrostratus
Bah, sorry for missing that! Good catch guys.
Aaron
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
