Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

redirecting a page request to a secure page

I have a dynamic page thing setup. How can I automate it so that when the access:

http://www.mysite.com/index.php?page=contribute

They instead get:
https://www.mysite.com/index.php?page=contribute
(notice the 's' is added)

I'm using PHP. I'm not sure how to do it.
0
Frylock
Asked:
Frylock
  • 2
  • 2
1 Solution
 
paulp75Commented:
you can place on that page

<?php
$URL="https://www.mysite.com/index.php?page=contribute";
header ("Location: $URL");
?>
0
 
paulp75Commented:
on the first url that is
0
 
UnTwstrCommented:
You could write a script at the top of the page to check $_SERVER["HTTPS"] and see if it is on or off. If its off, redirect to https://.

if ($_SERVER["HTTPS"] =="off"){
header("location:https://www.untwstr.com");
exit;
}
0
 
UnTwstrCommented:
sorry, replace the url i had with your url.....of course...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now