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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.