Forum Discussion
avaj_44503
Nimbostratus
Oct 29, 2012101 connection reset
Hi all.
Firstly, i have to thank to all contributors in this forum, because they've saved my life a lot of times.
Today i have a problem with one irule.
I am writing an irule t...
nitass
Employee
Oct 29, 2012not sure if you want redirection or rewriting.
this is an example of redirection.
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set newhost "www.ejemplo.com"
if { not ([HTTP::host] equals $newhost ) } {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "http://$newhost/[string map {www. ""} [HTTP::host]]"
} else {
HTTP::redirect "http://$newhost[HTTP::uri]"
}
}
}
}
[root@ve10:Active] config curl -I http://www.noejemplo.com/
HTTP/1.0 302 Found
Location: http://www.ejemplo.com/noejemplo.com
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://www.noejemplo.com/xyz
HTTP/1.0 302 Found
Location: http://www.ejemplo.com/xyz
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
