Jump to content

Loading a page with HTTPS makes $_POST come up empty


jhsachs

Recommended Posts

The problem: when the site loads a page using HTTPS, the new page is loaded but $_POST is empty.

 

I figured out how to fix it, but I'm posting for two reasons. First, to ask for insight into why the problem happened. Second, to help anyone who encounters the same problem.

 

I first tested the site with a temporary URL provided by the hosting service. This had the form servername.hostname.com/~accountname. For this test I used a self-signed certificate which covered servername.hostname.com. Everything worked.

 

Then I assigned the site its own domain name, created a certificate for www.owndomain.com, and tested again. That is when the problem occurred.

 

The cause: I was generating the URL of the HTTPS page without a server name; that is, in the form https://owndomain.com instead of https://www.owndomain.com.

 

I have a rewrite rule that rewrites owndomain.com to www.owndomain.com, and I suspect that has something to do with the problem. I believe a rewrite rule must explicitly incorporate parameters into the rewritten URL if it wants them, but since I'm using POST, not GET, I shouldn't have to do that (and can't).

 

More experienced developers, please: any insights into what happened?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.