Forum Discussion
jondyke_46152
Feb 02, 2012Nimbostratus
rewrite uri and redirect to https
Folks - I seem to be struggling with getting an irule working which does the following:-
If a client hits http://irule.com I want him to end up at https://www.irule.com
http://ir...
nitass
Feb 02, 2012Employee
can you try something like this?
[root@ve1023:Active] config b virtual bar list
virtual bar {
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "irule.com"}{
HTTP::redirect "https://www.[HTTP::host][HTTP::uri]"
}
}
}
[root@ve1023:Active] config curl -I http://irule.com/
HTTP/1.0 302 Found
Location: https://www.irule.com/
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