Operating System - Linux
1828228 Members
2741 Online
109975 Solutions
New Discussion

Automatically Having An SSL Connection To A Web Site

 
Andrew Kaplan
Super Advisor

Automatically Having An SSL Connection To A Web Site

I set up a server running 1.3.29 with mod_ssl. What I am looking to do is to configure the box so that when a user accesses it, the browser will automatically use SSL.

The first thing that I am planning to do is to have the server listen to only port 443. I need to set up a link so that when a user accesses the server, he/she will automatically be redirected to the correct port. What I don't want is to have the user need to include
the port when typing in the URL.

What is the best way to do this?
A Journey In The Quest Of Knowledge
1 REPLY 1
Martin P.J. Zinser
Honored Contributor

Re: Automatically Having An SSL Connection To A Web Site

Hello Andrew,

if you are using port 443 there is no need for an explicit port part in the URL all requests starting with https:// will use port 443 by default.

If your server only listens on port 443 the users need to know that they have to use https:// instead of http://

Another approach might be to use mod_rewrite, run the server also on port 80 and redirect all requests automatically to port 443. The rule should be similar to this

RedirectMatch permanent
/*
https://secure.server.net/*

Consult http://httpd.apache.org/docs/misc/rewriteguide.html

for details.

Greetings, Martin