Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Url redirect

Adnankhan
Nimbostratus
Nimbostratus

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.

 

 

3 REPLIES 3

Hi Adnankhan,

when HTTP_REQUEST {
	switch [HTTP::host] {
		"abc.org" -
		"def.org" -
		"ghi.org" {
			HTTP::respond 301 Location "http://xyz.com[HTTP::uri]"
			return
		}
	}
}

Adnankhan
Nimbostratus
Nimbostratus

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>