If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

HTTPS redirect MULTIPLE domain names

Here is the situation. I have a website that has two domain names. Each domain name points to the same server. Each domain may access http and https and serves the same content. Some users use one domain and others use the other domain. They each serve the same content.

I am looking for a means to redirect each domain request on http to its corosponding https page.

The PHP redirect thing could probably be made to work, with the exception possibly being if POST data is involved, in which case I'm not sure if a redirect would pass that along or not. (I guess it wouldn't be too hard to test that?)

You can look at $_SERVER['HTTPS'] to figure out if it needs to be redirected or not (see notes on this page if using IIS). I'd probably just do a couple tests outputting all of $_SERVER to figure out which other elements have the info needed to build your redirected URL: