diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb
index b80fd61b0..afd68f7e9 100644
--- a/spec/defines/vhost_spec.rb
+++ b/spec/defines/vhost_spec.rb
@@ -150,7 +150,8 @@
                   'directoryindex' => 'disabled',
                   'options' => ['Indexes', 'FollowSymLinks', 'MultiViews'],
                   'index_options' => ['FancyIndexing'],
-                  'index_style_sheet' => '/styles/style.css' },
+                  'index_style_sheet' => '/styles/style.css',
+                  'index_head_insert' => ['<base target=_blank>'] },
                 { 'path' => '/var/www/files/output_filtered',
                   'set_output_filter' => 'output_filter' },
                 { 'path' => '/var/www/files/input_filtered',
@@ -671,6 +672,7 @@
               .with_content(%r{^\s+Options\sIndexes\sFollowSymLinks\sMultiViews$})
               .with_content(%r{^\s+IndexOptions\sFancyIndexing$})
               .with_content(%r{^\s+IndexStyleSheet\s'/styles/style\.css'$})
+              .with_content(%r{^\s+IndexHeadInsert\s'<base target=_blank>'$})
               .with_content(%r{^\s+DirectoryIndex\sdisabled$})
               .with_content(%r{^\s+SetOutputFilter\soutput_filter$})
               .with_content(%r{^\s+SetInputFilter\sinput_filter$})
diff --git a/templates/vhost/_directories.erb b/templates/vhost/_directories.erb
index 60b7eb917..b676ade57 100644
--- a/templates/vhost/_directories.erb
+++ b/templates/vhost/_directories.erb
@@ -42,6 +42,9 @@
       <%- end -%>
       <%- if directory['index_style_sheet'] -%>
     IndexStyleSheet '<%= directory['index_style_sheet'] %>'
+      <%- end -%>
+      <%- if directory['index_head_insert'] -%>
+    IndexHeadInsert '<%= Array(directory['index_head_insert']).join(' ') %>'
       <%- end -%>
       <%- if directory['allow_override'] -%>
     AllowOverride <%= Array(directory['allow_override']).join(' ') %>