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
Thanks Bhattman. When I try to add your text just as you have it I get the message below. Am I missing some syntax?
01070151:3: Rule [mydomain.org_301-redirect] error:
line 1: [wrong args] [when HTTP_REQUEST{]
line 2: [command is not valid in the current scope] [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]" }
}]
line 2: [command is not valid in the current scope] [string tolower [HTTP::host]]
line 2: [command is not valid in the current scope] [HTTP::host]
line 6: [command is not valid in the current scope] [}]
Thanks,
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