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...
The_Bhattman
Jul 26, 2011Nimbostratus
Hi Dave,
Here is an example using the switch command.
when HTTP_REQUEST{
switch -glob [string tolower [HTTP::host]] {
"www.*" { HTTP::respond 301 "http://mydomain.org[HTTP::uri]" }
"mydomain.com*" { HTTP::respond 301 "http://mydomain2.org[HTTP::uri]" }
}
}
I hope this helps
Bhattman
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