Forum Discussion

ukitsysadmin_95's avatar
Icon for Nimbostratus rankNimbostratus
Jan 18, 2011

matchclass http::path compare question

I was wondering is anyone can help.



We are upgrading our site and changing the DB structure which means all our old http::paths will no longer work and need redirecting to the new http::path, the http::header will stay the same every time.




We have about 40,000 http::paths that will need redirecting




The http::host, will stay the same every time e.g.




I was thinking of placing all the old http::paths into an external data group






















+40,000 more in this format




The numbers in the path reference the DB id's




the new_paths (are almost the same but the DB id's)














+40,000 more in this format




The old Paths will produce a status 404, once we switch over




so is it possible






if { [matchclass [HTTP::path] ends_with $::old_urls] } and { status equals 404 {



{ [matchclass [HTTP::path ends_with $::new_urls] } redirect {






What I mean is


if the http::path ends with any of the 40,000 "old_url" entries then search the "new_urls" if a match,


redirect the http:host + http::path "new_url"




e.g. some ones bookmark =




irule should take "ted", which is listed in "old_url" external data group,


search the "new_url" for http::path which ends_with "ted"


then take full http::path which "ted" ends with and append to http::host








Note: all the "end_with" text are individual so NO duplicate, thus my request should not cause any problems (if that makes sense)






We are currently using BigIP LTM version 9.4.7











1 Reply

  • You can definitely accomplish this with data groups. I don't suppose you can upgrade to 10.x?



    I imagine using "class search - value" is going to be much more efficient than extracting a value with match class.



    I understand your old_urls class is what would contain the paths, but am a bit confused about what you'd like to do if there's a match? It looks like you want to send the user a redirect? Will that redirect send them to a value to which the old url corresponds?