---
title: "Apache, Tvinga SSL och WWW"
type: "forum-thread"
url: "https://www.webforum.nu/amne/webbservrar/192221-apache-tvinga-ssl-och-www"
topic: "Webbservrar"
topic_url: "https://www.webforum.nu/amne/webbservrar"
author: "MickeA.com"
published: "2014-03-26T03:43:39.000Z"
updated: "2014-03-26T03:43:39.000Z"
replies: 0
views: 792
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/webbservrar/192221-apache-tvinga-ssl-och-www"
---

# Apache, Tvinga SSL och WWW

## #1 — MickeA.com, 2014-03-26T03:43Z

Tjena hej

Har följande i en configfil för en virtual host: 

```
  RewriteEngine on
  RewriteCond %{HTTP_HOST} !^$ [OR]
  RewriteCond %{HTTP_HOST} !^www\. [NC,OR]
  RewriteCond %{HTTPS} !=on
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]
```

Det fungerar *nästan*... Dessa skrivs som som dom ska:

```
http://domain.com
[url]http://www.domain.com[/url]
```

Men om jag anger **<https://domain.com>** får jag "Page not found". Har givetvis med domain.com som ServerAlias, och **<http://domain.com>** fungerar som det ska, men **<https://domain.com>** fungerar inte.

Förslag någon?

Permalänk: https://www.webforum.nu/p/192221

---

Tråden på webben: https://www.webforum.nu/amne/webbservrar/192221-apache-tvinga-ssl-och-www
