PHP FastCGI POST Requests Failing

Mar 9, 2012 System Administration


I was working with a site that had to be migrated from a Virtual Dedicated Server to a GoDaddy 4GH plan and ran into an issue where POST forms passed through mod_rewrite were not being populated to $_POST. I realized that in a FastCGI environment the requests will be redirected as a GET string, meaning that your POST data will be lost.

It was a 1-liner in the .htaccess file.

Adding a Fix

If you have a R=301 in the brackets [], remove it so it looks like below:

# On FastCGI replace the last line above with this: 
RewriteRule ^(.\*)$ index\.php?/$1 [L] 


comments powered by Disqus