From c635811facd5c17075e9c754cbd2ac1d960edd4f Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 24 Dec 2018 14:33:23 +0100 Subject: [PATCH] Switch to RewriteEngine to allow redirection to the same host. --- templates/default_vhost.conf.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/default_vhost.conf.j2 b/templates/default_vhost.conf.j2 index f58d778..47bc54b 100644 --- a/templates/default_vhost.conf.j2 +++ b/templates/default_vhost.conf.j2 @@ -3,5 +3,7 @@ NameVirtualHost *:{{ httpd_port }} ServerName {{ httpd_servername }} DocumentRoot "{{ httpd_data_directory }}" - Redirect permanent / https://{{ httpd_servername }} + RewriteEngine On + RewriteCond %{HTTPS} !=on + RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]