if it is always the same format like www.[host] need to be redirected to [host] then a simple iRule that extract the first part should do the job
But if it is not so consistent, you can build a datagroup which says for each host what should be the redirect
ex:
this class definition is what you see in your bigip.conf file when you define a datagroup
class hostredirects {
"www.nnn.sitename.com http://nnn.sitename.com"
"www.nan.sitename.com http://someotherhost.nowhere.com"
}
when HTTP_REQUEST {
set location [findclass [HTTP::uri] $::hostredirects " "]
if { $location ne "" }
HTTP::redirect $location
}
}