not 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