Forum Discussion

mtalebi_64623's avatar
mtalebi_64623
Icon for Nimbostratus rankNimbostratus
Jul 19, 2010

Newbie - How to do Apache like rewrites/redirects in F5 Load Balancer?

Hello,

 

 

I am completely new to using load balancers so please forgive me if my questions sound naive. We have always used Apache rewrites to redirect URLs. We are in the process of creating a new public website for our college using Drupal as our content management system. We have an F5 load balancer setup to distribute requests between two Drupal web servers. Since we are moving from our old single server PHP website to a Drupal website, we need to setup rewrite rules so requests that hit our website can go to our old web server for content we have not transfered over yet.

 

 

A type of rewrite we are looking to do would be as follows:

 

 

Redirect all requests from this path www.school.edu/dl to webarchive.school.edu/dl

 

 

Anything after the /dl should also be included in the rewrite/redirect.

 

 

Can someone point me to some documentation that would explain how to do this or give me some advice?

 

 

Does this plan make sense? (doing the redirects at the F5 would reduce the traffic reaching the web servers plus I don't have to duplicate rewrites at the web server config files)

2 Replies

  • As Chris suggested, you can definitely do Apache style rewrites and redirects efficiently in an iRule. There are a lot of examples in the Codeshare and iRule forum. You can find related posts if you search the iRule forums for "mod_rewrite".

     

     

    If you have a lot of source/targets to rewrite or redirect, it would be clean and efficient to add them to a string datagroup and then use findclass (v9) or class (v10) to look them up. Here are another couple of links:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/class (v10)

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/findclass (v9)

     

     

    Aaron