Forum Discussion
Brian_Kenworthy
Feb 10, 2011Nimbostratus
HTTP>HTTPS Redirect to different domain
Hi all, this should be pretty simple....hopefully.
I have a simple HTTP>HTTPS redirect in place for a domain --> HTTP::redirect "https://[HTTP::host][HTTP::uri]"
We have several su...
nitass
Oct 11, 2012Employee
e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if {$host ends_with "domaina.com"} {
HTTP::redirect "https://[string map {"domaina.com" "domainb.com"} $host][HTTP::uri]"
}
}
}
[root@ve10:Active] config curl -I http://172.28.19.79/something -H "Host: www.domaina.com"
HTTP/1.0 302 Found
Location: https://www.domainb.com/something
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://172.28.19.79/something -H "Host: xxx.yyy.domaina.com"
HTTP/1.0 302 Found
Location: https://xxx.yyy.domainb.com/something
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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