Koozali.org: home of the SME Server

http:// vs https://

jhale1966

http:// vs https://
« on: June 09, 2006, 07:51:41 PM »
We need to run a secure website on our server. The only problem is that you can get to it either by using http://www.website.com OR https://www.website.com.

What do we need to do so that it is ONLY accessible using https? Is there a way to setup a redirect if a user only used http?

Thanks!

Offline mmccarn

  • *
  • 2,656
  • +10/-0
http:// vs https://
« Reply #1 on: June 10, 2006, 06:08:41 AM »
I do this by creating Primary/html/index.html like this:

Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
    <head>
        <title>This is the Title</title>
        <meta http-equiv="REFRESH"
        content="0;url=https://www.website.com/home.html"></HEAD>
        <BODY>
        Website.com Redirect
        </BODY>
        </HTML>
[/size]

Then use "home.html" (or some other file, or another ibay entirely) to contain the actual homepage.

By the way - the only part of this that matters is the <meta http-euiv...> stuff. content="0;url=blahblahblah"> causes a redirect to the indicated URL after zero seconds.  If you replace the zero with a 5 then you get a page that redirects after 5 seconds - presumably so folks have time to read your message saying you've moved your site...

You can also do this with template fragments that reconfigure Apache to redirect http:/www.website.com to https://www.website.com, but I don't know how to do this!

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
http:// vs https://
« Reply #2 on: June 10, 2006, 09:01:14 AM »
Quote from: "mmccarn"

You can also do this with template fragments that reconfigure Apache to redirect http:/www.website.com to https://www.website.com, but I don't know how to do this!


Have a look at /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/30WebmailAliases for a sample RewriteRule.

JB
......

icpix

http:// vs https://
« Reply #3 on: June 10, 2006, 10:15:50 AM »
If you use a packet-sniffing router you could redirect port 80 to 443.

icpix

http:// vs https://
« Reply #4 on: June 10, 2006, 08:06:09 PM »