Forum Discussion
Carol_Williams_
Nimbostratus
Jun 13, 2006Send a 301 error instead of 302 with redirect
I am using version 4.6.4 and currently have a rule to direct everything coming in without a www to www.sitename.com. I would like to tell F5 to make this a permanently moved(301 error) instead of a temporary moved(302 error). Is there a way to do this with irules?
Here is the Rule:
if (http_host == "mysite.com") {
redirect to "www.mysite.com/%u"
}
else {
use pool mypool
}
Thanks
Carol
- Deb_Allen_18Historic F5 AccountHi Carol -
- gbhavanishan_83
Nimbostratus
I have a customer request of which I'm unsure whether it can be done at all or not: I have a URL where it is redirect from http to https . issue: There Application team asking why TES application has 302 redirection instead 301. What would be the impact to change 302 to 301. What are the requirement if we need to redirect to 301 - Eric_St__John
Employee
What version of code are you using? If you are using v9 or newer you can do something like this:when HTTP_REQUEST { HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri] }
- Stuart_Feathers
Nimbostratus
That worked perfectly for me, thanks for the sample code Eric!
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