diff --git a/manifests/init.pp b/manifests/init.pp
index 3373cc6b95782cd1b2d5f226e3010bd505cacd79..2b1a79ba70fe820856405c6ae7d916a9d8fc25ef 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -57,6 +57,7 @@ class skadereg {
   class { '::apache::mod::php':
     package_name => 'php55-php'
   }
+  include ::apache::mod::rewrite
 
   package { 'php55-php-pdo':
      ensure => installed;
@@ -88,37 +89,21 @@ class skadereg {
   }
   
   apache::vhost { "${::fqdn}:443":
-    servername            => $::fqdn,
-    port                  => '443',
-    ssl                   => true,
-  #  ssl_cert              => $cert,
-  #  ssl_chain             => $chain,
-  #  ssl_key               => $key,
-    headers               => ['Set Strict-Transport-Security "max-age=31536000"',],
-    docroot               => '/var/www/skadereg/public',
-    proxy_preserve_host   => true,
-    allow_encoded_slashes => 'on',
-    rewrites              => [
+    servername  => $::fqdn,
+    port        => '443',
+    ssl         => true,
+  #  ssl_cert   => $cert,
+  #  ssl_chain  => $chain,
+  #  ssl_key    => $key,
+    headers     => ['Set Strict-Transport-Security "max-age=31536000"',],
+    docroot     => '/var/www/skadereg/public',
+    directories => [
       {
-        'rewrite_cond' => [
-          '%{REQUEST_FILENAME} !-d',
-        ],
-        'rewrite_rule' => [ '^(.*)/$ /$1 [L,R=301]' ]
-      },
-      {
-        'rewrite_cond' => [
-          '%{HTTP:Authorization} ^(.*)'
-        ],
-        'rewrite_rule' => [ '.* - [e=HTTP_AUTHORIZATION:%1]' ],
-      },
-      {
-        'rewrite_cond' => [
-          '%{REQUEST_FILENAME} !-d',
-          '%{REQUEST_FILENAME} !-f',
-        ],
-        'rewrite_rule' => [ '^ index.php [L]' ],
-      },
-    ],
+        path           => '/var/www/skadereg/public',
+        allow_override => [ 'ALL' ],
+        directoryindex => 'index.php',
+      }
+    ]
   }
 
   file { '/var/www/skadereg/':