I have a doubt. We need to do something like this: We have an domain: we need that if a user put this direcction in his/her browser, the F5 send it to a server x.x.x.x, but if the user put www.example.com/something the F5 should sent it to a y.y.y.y server.
@OTS02 's suggestion will work, but you have to consider other resources that are likely included. For instance, where are images, scripts, style sheets etc located?
In general, you may want to have a default server and a server for exceptions (e.g.
/something
). If possible, have the site owner use the subfolder for supporting files (images, style sheets, scripts) where that makes sense.
It can get tricky if you’re using dynamic resources that require persistence even though they are hosted in different ‘folders’. For instance, some .NET applications use
/websource.axd
for dynamically generated resources (e.g. images). If the page under
/something
instructs the client to request
/webresource.axd
you’ll have to add some intelligence to the iRule to ensure that the request isn’t routed to the other pool.
Also, consider that pages (especially the home page) can be called in a variety of ways. For instance, the home page could be
/
,
/index.html
,
/default.aspx
,
/index.php
, etc.
Lastly, you’ll probably want to use
HTTP::path
instead of
HTTP::uri
as the latter includes the query string parameter, which would have an effect on the string comparison you’d be doing to route the request to the proper pool.
I like iRules too, but I honestly think the best approach for you is the LTM Policies… For example, define the default pool on your VS (the one where requests NOT matching the “/something” go), and define an LTM Policy searching for the matching HTTP URI, and in action send to the right pool for that URI.