Hi,
The error is returning when it is trying to open the thanks.html.
To prove to see where the problem lies either have your thanks.html in the root along with all your other html files not in the cgi-bin.
Or remove the redirect from the html in the contact page and see if you get the default formail thankyou page.
Thanks
Paul