Forum Discussion
James_Hamoline_
Nimbostratus
Sep 20, 2005301 Redirection via iRule
I currently have an iRule that redirects users. However, HTTP:redirect does a temporary redirect (HTTP Status Code 302). I want a permanent redirect (HTTP Status Code 301).
Here is the iRule:
when HTTP_REQUEST {
HTTP::redirect "http://www.[HTTP::host][HTTP::uri]"
}
Basically, when this iRule runs it tacks on the www.
Does anybody know how I can get this iRule to do a 301 Permanent Redirect?
- You could use the "HTTP::respond" command to send any HTTP response code you want back to the client.
when HTTP_REQUEST { HTTP::respond 301 "Location" "http://www.[HTTP::host][HTTP::uri]" }
- James_Hamoline_
Nimbostratus
Thanks, - The documentation currently exists in the BIG-IP Product Documentation. Check out "Configuration Guide for Local Traffic Management (updated 7/25/2005)" on ask.f5.com for documentation on iRules syntax.
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