WordPress Comments Messed Up with Redirection … and the Hack
Read the comments
Read the comments
I am a 35 year old guy from Lahore, Pakistan currently living in Abbottabad. I have been playing with computers for 20 years, making money from them for 14 years, and experimenting with a coffee shop for the last 1.5 years.
Please subscribe to the RSS feed to stay up to date.
Follow @ReallyVirtual
I was told by two Pak Spectator readers (thanks guys) that the comments here are not working. My bad. I never checked them after setting up the domain redirection, so I spent an hour on the problem and found out (and fix(hack)ed the issue).
For those of you that are interested or facing the same issues, it seems that the comment form (from comments.php in WordPress) sends a ‘POST’ request to wp-comments-post.php, which gets lost in redirection and mutates into a ‘GET’ request. The comments.php also uses the blog domain (www.reallyvirtual.com in this case), but since the redirection is posting on a subdomain (rv.cypherone.com), WordPress rejects it.
The workaround: Edit your theme’s comments.php and hardcode the form ‘action’ domain to the ultimate destination domain, and then comment out the first block wp-comments-post.php so that WordPress bypasses the POST check. Finally, you may have to search replace all $_POST with $_GET.
This leaves the door wide open for comment spammers, but at least the comments are working now, so I can put off a hosting move for another few weeks.
UPDATE: after moving to linux hosting, I can finally restore the hack to its original code.
very interesting, but I don’t agree with you
Idetrorce