if you are not mod_rpaf then how could you do all this with apache modules
very tough code it can be reduced to simplicity