Forum Discussion
DaveC_53879
Jul 29, 2011Nimbostratus
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...
DaveC_53879
Aug 08, 2011Nimbostratus
Aaron,
Making progress. I setup a test site to make this managable. I edited your rule to reflect the test site.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "www.*" { HTTP::respond 301 "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]" } } }
Log entry for http://ddcpoc.com/hello.txt
Aug 8 12:49:06 tmm tmm[1710]: Rule ddcpoc_301_redirect : 216.2.59.100:32122: Doing nothing for ddcpoc.com/hello.txt
Log entry for http://www.ddcpoc.com/hello.txt;
Aug 8 12:49:15 tmm tmm[1710]: Rule ddcpoc_301_redirect : 216.2.59.100:32251: Redirecting to http://ddcpoc.com/hello.txt
But it doesn't redirect. I still show the original URL in the address window and IE says page cannot be displayed. Firefox returns a completely blank page with no errors.
In Fiddler, I see;
301 HTTP www.ddcpoc.com /hello.txt 0 iexplore:1712
For the test site, www actually works if I remove the irule.
It looks like it should be working, but...
Thanks a lot for your help.
Dave
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