Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tried this example from OpenBSD

it works fine, but with Mozilla Firefox 6.0 it's possible to use both http and https, while I want to force users to use only HTTPS. How can I achieve this?


share|improve this question

marked as duplicate by Jenny D, Ward, growse, Bryan, mdpc Jul 16 '13 at 16:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

This makes no sense at all.. can you rephrase your question? – pauska Aug 17 '11 at 10:24

You control that in what ever web server you use. You're going to want to 301 redirect to your HTTPS site.

share|improve this answer

You can restrict connections to your website to require HTTPS, by using the mod_ssl directive


This directive forbids access unless HTTP over SSL (that is HTTPS) is enabled for the current
connection. It is very handy inside the SSL-enabled virtual host or directories as a defense 
against configuration errors that expose data that should be protected. When this directive 
is present, all requests that do not use SSL are denied. 

The FAQ entry you referenced discusses setting up your website to support SSL, the directive SSLRequireSSL is what you would use to specify restrictions per the whole site (or the specific Alias/Directories within your site.)

share|improve this answer

You can redirect to, but it means that clear-text HTTP is still being used just to send the HTTP Redirect.

This exposes the user to attacks by tools such as sslstrip, unless he carefully checks every time that the domain is really, not, not, not https://(insert non-Latin homoglyphs here).com...

In this case, you really want to use HTTP Strict Transport Security:

HTTP Strict Transport Security (HSTS) is a proposed web security policy mechanism where a web server declares that complying user agents (such as a web browser) are to interact with it using secure connections only (such as HTTPS).

share|improve this answer
  1. If a station security issue, you can use this firefox extension to force only https for all sites HTTPS Everywhere.
  2. If a perimeter security issue, you can use a proxy forward server to redirect all http requests to https.
  3. Finally, if you have a web server just make diferent paths for http and https. In https you will put your site and in http you will put just a index.html file using meta refesh. <meta http-equiv="refresh" content="0; url=">
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.