Forum Discussion
2 Replies
Sort By
- crodriguezRet. Employee
There are lots of redirect examples on DevCentral, but here is a simple iRule that should work.
when HTTP_REQUEST { if { [HTTP::host] equals "www.universitysite.com" } { HTTP::redirect "https://newsite.com[HTTP::uri]" } }
This can also be done more efficiently with a Local Traffic Policy than with an iRule. The condition would look something like this:
HTTP Host full string is any of at request time
The action would look something like this:
Redirect to location tcl:https://newsite.com[HTTP::uri]
See this answer for more details.
- wlopezCirrocumulus
You could also do it this way:
when HTTP_REQUEST { if { [HTTP::host] equals "www.universitysite.com" } { HTTP::respond 301 Location "new-site.com[HTTP::uri]" } }
Just modify the if statement to cover the scenarios you want to perform the redirect on.