Forum Discussion

Fotios_30046's avatar
Fotios_30046
Icon for Nimbostratus rankNimbostratus
Oct 28, 2009

Strip Everything But HTTP::host

We're redirecting users a temporary server with new pools and virtual servers during a maintenance update and we want to strip off any http::path or http::uri and just send people to the http::host using this redirect.

 

 

when HTTP_REQUEST {

 

HTTP::redirect "http://[HTTP::host]"

 

}

 

 

This is probably the fastest and simplest ways to do it right?

2 Replies

  • You could rewrite the URI to / using HTTP::uri / instead. The client wouldn't see the change and it wouldn't result in a redirect and a second HTTP request. You could also select the "maintenance" pool using the pool command (Click here).

     

     

    If you do want to use a redirect, make sure to redirect to "http://[HTTP::host]/" as the redirect location must have a URI of at least /.

     

     

    Aaron
  • That would work, except the maintenance is a move to a new facility with new equipment. However this new site only has temporary pages while we drive the servers between sites. Which is why I created new pools and virtual servers. I'll add the trailing "/" to the iRule, I can't believe I missed that.