Contact-Form-7 with IIS

I’ve been using the “Con­tact Form 7″ plu­gin, but found I had a prob­lem with a WP install on a Win­dows IIS host. The prob­lem seems to stem from perma­links not work­ing prop­erly with IIS and hav­ing to cre­ate a file to fake them by redi­rect­ing 404 errors to the right place — this appar­ently gets in the way of post­ing the form. A quick google threw up this sup­port topic and a few posts sug­gest chang­ing contact-form-7/includes/classes.php. The sug­gested changes didn’t work for me, but I found that set­ting the form sub­mit url to the “dirty” page url (i.e. /index.php?page_id=11) plus the form name did the job. So, instead of

$url = wpcf7_get_request_uri();

I now have

$url = ‘/index.php?page_id=11#wpcf7-f1-p11-o1’;

Good enough rea­son to stick with linux web servers that guar­an­tee Apache as the web server rather than IIS!

Speak Your Mind