Forum Discussion
nitass
Nov 09, 2011Employee
HTTP::redirect returns 302. if it is permanent, using 301 may be better.
What's the difference between 301 redirects and 302 redirects
http://webdesign.about.com/od/http/qt/tip301v302redir.htm
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.65.152:https
ip protocol tcp
rules myrule
profiles {
clientssl {
clientside
}
http {}
tcp {}
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "www.oldsite.com"} {
HTTP::redirect "https://www.newsite.com[HTTP::uri]"
}
}
}
[root@ve1023:Active] config curl -Ik https://www.oldsite.com
HTTP/1.0 302 Found
Location: https://www.newsite.com/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "www.oldsite.com"} {
HTTP::respond 301 Location "https://www.newsite.com[HTTP::uri]"
}
}
}
[root@ve1023:Active] config curl -Ik https://www.oldsite.com
HTTP/1.0 301 Moved Permanently
Location: https://www.newsite.com/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0