You're going to have to have 200 lines somewhere, but probably better to do it in a data group. So if I understand you, the new hostname is dependent on the requested parent directory, correct? If so, how about something like this:
Data group (example: "my_datagroup")
"/parentdirectory1/" := "hostname1"
"/parentdirectory2/" := "hostname2"
...
"/parentdirectory300/" := "hostname300"
iRule:
when HTTP_REQUEST {
if { ( [string tolower [HTTP::host]] equals "hostname.com" ) and ( [class match [string tolower [HTTP::uri]] starts_with my_datagroup] ) } {
HTTP::redirect "http://[class match -value [string tolower [HTTP::uri]] starts_with my_datagroup][HTTP::uri]"
}
}
I've also made a giant assumption here that the hostname is the same for all of the old stuff. If not, your data group key might actually be the old hostname and the parent directory.
Example:
"hostname.com/parentdirectory1/" := "newhostname1.com"