Forum Discussion
DaveC_53879
Jul 26, 2011Nimbostratus
Return a 301 instead of 302
I need my redirects to return a 301 instead if a 302. The Web team is unable to track the rdirected requests because they return a 302. How can I change the rule below to return a 301?
whe...
DaveC_53879
Jul 27, 2011Nimbostratus
OK. I figured out the syntax; a missing space. But my rule doesn't work. It just returns a blank page. Sanitized rule below, so there may be some duplicates.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"www.*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"peoples.net*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"peoples.com*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"peoples.mobi*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"peoplesfor.org*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"peoplesfor.net*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"peoplesfor.com*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"speople.net*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"speople.org*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"speople.com*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"people.net*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"people.com*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"-people.org*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"-people.net*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"-people.com*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"-peoples.org*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"-peoples.net*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"-peoples.com*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
"people.org*" { HTTP::respond 301 "http://peoples.org[HTTP::uri]" }
}
}
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