Forum Discussion
Heidi_35827
Nimbostratus
Nov 08, 2011iRule for HTTP redirect from retired URL to new URL
I'm new to iRules and could use some help. I think I have a pretty basic question but I'm not finding the answer after a few searches in DevCentral.
Here is what I'm trying to do....we ha...
Heidi_35827
Nimbostratus
Nov 10, 2011We are not doing SSL termination for this site. Could that be part of the issue? I realize we will get a cert error when using the old address, but the redirect should still work right?
I tried 2 variations of the above iRules with the same results. Both times, my vserver for www.newsite.com quit responding. It would not load the site either by using www.newsite.com or by using www.oldsite.com. When I would put the address in the browser, it would spin and spin, never loading a page. As soon as I removed the profile and iRule, the www.newsite.com began working again.
I modified the 443 vserver for www.newsite.com, selected the default http profile for that vserver, and then applied my iRule to the vserver. Here are the 2 iRules I tried....
iRule 1:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "www.oldsite.com" } {
HTTP::respond 301 Location "https://www.newsite.com"
}
}
iRule 2:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "www.oldsite.com" } {
HTTP::redirect "https://www.newsite.com"
}
}
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