Forum Discussion
Url redirect
Hello Everyone,
I would like to do the following, Any help would be appreciated.
I have 3 URLs abc.org, def.org and ghi.org they all point to the same vip, i would like, when user go to these URLs, URL should change to xyz.com(new vip with the same ip).
Please let me who i can achieve this. thanks in advance.
Hi Adnankhan,
when HTTP_REQUEST { switch [HTTP::host] { "abc.org" - "def.org" - "ghi.org" { HTTP::respond 301 Location "http://xyz.com[HTTP::uri]" return } } }
- AdnankhanNimbostratus
Hi eaa,
i have tried this
when HTTP_REQUEST {
switch [HTTP::host] {
"abc.org" {
HTTP::respond 301 Location "http://xyz.com[HTTP::uri]"
return
}
}
}
but it doesn't change the URL.
Hi Adnankhan,
I guess your test client's traffic isn't pass over F5.
Can you review the logs and tcpdump?
when HTTP_REQUEST { log local0. "vslog1 | CIP: [IP::client_addr] | Host: [HTTP::host]" switch [HTTP::host] { "abc.org" { log local0. "vslog2 | CIP: [IP::client_addr] | Host: [HTTP::host]" HTTP::respond 301 Location "http://xyz.com[HTTP::uri]" return } } }
logs:
tail -f /var/log/ltm | grep vslog
tcpdump:
tcpdump -ni 0.0 host <virtualserverIP> and host <clientIP>
Recent Discussions
Related Content
* 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