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

Redirect to a node with context

Javi_Lora
Altostratus
Altostratus

I'm trying to create a rule that when it comes with a context it redirects me directly to a node with another context.

 

Example:

 

when HTTP_REQUEST {

  if {([HTTP::uri] starts_with "/citapreviarrcc") } 

     {

node "xxxxxxxxxxx:8080/citaprevia"   

  }

 

But F5 tells me that it is not possible.

 

Is there a way to do it.

 

Thanks.

1 REPLY 1

Hi Javi Lora,

when HTTP_REQUEST {
	if { [HTTP::uri] starts_with "/citapreviarrcc" } {
		HTTP::uri "/citaprevia"
		node 1.2.3.4 8080 
	}
}

If you want to see changed uri in browser:

when HTTP_REQUEST {
	if { [HTTP::has_responded] } { return }
	if { [HTTP::uri] starts_with "/citapreviarrcc" } {
		HTTP::redirect "http(s)://[HTTP::host]/citaprevia"
		return
	}
	elseif { [HTTP::uri] equals "/citaprevia" } {
		node 1.2.3.4 8080
	}
}