Forum Discussion
M_Housley_11941
Nimbostratus
Nov 22, 2013Irule - change 302 redirect iRule to a 301 redirect
I have the following 302 redirect iRule running, but i need to change it to a 301 redirect. I have a potential solution - would someone be able to verify it for me?
Existing rule: -
when HTTP_RE...
John_Alam_45640
Nov 22, 2013Historic F5 Account
The HTTP::redirect expects only the destination URL and it constructs a redirect for you.
So, for the HTTP::respond, you have to specify the "Location" header which normally contains the destination URL.
Here is how you do it:
HTTP::respond 301 Location $newuri
more examples here: https://devcentral.f5.com/wiki/iRules.HTTP__respond.ashx
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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