[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Redirect http to https
- Subject: Re: [cobalt-users] Redirect http to https
- From: "Jamie Martino" <webmaster1@xxxxxxx>
- Date: Wed Jan 9 20:12:37 2002
- Organization: WebConnection.Net, Inc.
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
>
> Sorry, misunderstood the question..
>
> Make the form a dynamic page, like CGI/ASP/PHP, and have it check the URL
> and make sure it is being accessed securely, and if it's not, reload the
> page over HTTPS.. Otherwise just show the form.. Very simple to write..
I couldn't help myself and wrote-up a simple CGI script that will check the
URL and make sure it is being accessed over HTTPS...
********************* BEGIN CODE *********************
#!/usr/bin/perl
use CGI qw(:standard);
$query = new CGI;
$currentURL = $query->url();
$secureURL = "https://www.domain.com/secureform.cgi;
if ($currentURL eq $secureURL) {
print "Content-type: text/html\n\n";
print "Secure OK, put HTML here...";
} else {
print "Location: $secureURL\n\n";
}
exit;
********************* END CODE *********************
-Jamie-
http://w-c.net
WebConnection.Net, Inc.
In a mad world, only the mad are sane...