I think what I was asking for was a bit hard to understand, so, I am trying to make it simpler...
I need my server to have a custom 400 error page when it receives a request with a malformed host header.
What I ideally want is
ErrorDocument 400 \somepage.php
I can generate 400 errors by visiting a page such as
http:\\myserver\bla%bla, and this will go to my script fine. Likewise, I can change the
\somepage.php section to
Test text and Apache will return that text.
If however, the 400 error is due to a malformed host header, it will work with the text but not the web page.
Can anyone shed any light on this and give a working solution before I loose all my hair?! (already lost quite a bit over this!).