Hi.
I'm to launch my site on a linux server using PHP and mySQL.
I have to areas for documents on the server:
one for secured connection and one for nonsecure connection.
[url]HTTPS://[/url] using encryption and [url]HTTP://[/url] without encryption
In short:
Does anyone know how I can redirect back to a page in a nonsecured path ([url]HTTP://...[/url]) from a document in a secured path ([url]HTTPS://...[/url]) ???
Example code please...
Here is my code and paths on the server:
I have some pages within the nonsecured area that should only be accessible to registered members. I have put the login page in the [url]HTTPS://[/url] area.... : HTTPS://www.mydomain.com/login.php
The non secured documents is in this path:
HTTP://www.mydomain.com/php-pages/page-n.php
When a user that is not allready logged in tries to access page-n.php in the nonsecured area he will be directed to:
https://www.mydomain.com/login.php using the header function like this:
header("Location: https://www.mydomain.com/login.php");
this works fine
After he successfully has logged in he will be (should be :-) ) directed back to the page-n.php in the nonsecure area...
I tried to do this from the loginpage using:
header ("Location: http://www.mydomain.com/php-pages/page-n.php);
which gave me this result in the browser:
https://www.mydomain.com/http://www.mydomain.com/php-pages/page-n.php ... document not found of course...
And I also tried this from login page:
header ("Location: /php-pages/page-n.php);
which gave me this result in the browser:
https://www.mydomain.com/php-pages/page-n.php ... document not found of course...
Does anyone know how I can redirect back to a page in a nonsecured path ([url]HTTP://...[/url]) from a document in a secured path ([url]HTTPS://...[/url]) ???
Example code please...