Forum Discussion
Inserting 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]" }
}
}
- Peter_72728NimbostratusWhat do you mean by "it also returns a blank page"? Does the browser correctly process the 301 by requesting the new URI? And then the resulting page is a 200 but it's blank?
Also... What's the value of [HTTP::uri]? What is the actual location that the 301 sends the browser to? And is there a (non-blank) page at that URL?
- DaveC_53879NimbostratusIt returns page cannot be displayed, in othwer words, nothing. The redirect does not work. The value of [HTTP::uri] could be anything or nothing. All I want to change in the original request is the hostname while returning a 301 instead of a 302. A straight http redirect works fine.
- Peter_72728Nimbostratusok...I wasn't getting that. I'd recommend using Fiddler or Charles to see the actual response. "Page cannot be displayed" is so vague...and very uninformative when trying to debug. :)
My first thought is that you have an error occurring in the iRule and the connection is getting dropped. I've had this happen in many occasions when the path through my iRules resulted in a second redirect instruction being sent.
Have you checked the logs to see if they shed any light in the subject?
- hooleylistCirrostratusYep, checking /var/log/ltm for TCL errors would be a good start. You can also try testing with curl from the LTM command line:
- DaveC_53879NimbostratusThanks Peter and Aaron for responding. I was away for a few days. There's nothing being recorded in /var/log/ltm for this rule. It returns a 301 which I can see in Fiddler, but it is not redirecting to the working URL as I need it to do, which is why I get Internet Explorer cannot display the webpage, because there is none except at the redirect URL.
- hooleylistCirrostratusHi Dave,
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]" log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting to http://synergycitizens.org[HTTP::uri]" } default { log local0. "[IP::client_addr]:[TCP::client_port]: Doing nothing for [HTTP::host][HTTP::uri]" } } }
- DaveC_53879NimbostratusAaron,
- hooleylistCirrostratusI think the iRule is working as designed--it's redirecting www.* correctly. I think the issue is with requests sent to the pool with a host header of ddcpoc.com. If you make a request from LTM using curl, does it work?
- DaveC_53879NimbostratusThat worked OK. See below. I don't doubt that the F5 is redirecting, but the browser doesn't seem to be happy with what it's getting back. I just don't know what that is. Could it be a version issue? I'm running 9.4.6.
- DaveC_53879NimbostratusAaron,
Recent Discussions
Related Content
* 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