Skip to content

Commit

Permalink
fix bug in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhandwell committed May 11, 2015
1 parent f595b7d commit 6cb7d79
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion templates/default/apache2.conf.erb
Expand Up @@ -91,7 +91,14 @@ AccessFileName <%= node['apache']['access_file_name'] %>
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
<% access_file_name_prefix = node['apache']['access_file_name'][0..2] if !node['apache']['access_file_name'].empty?
if access_file_name_prefix != '.ht'
file_name_prefix = '(' + access_file_name_prefix + '|.ht)'
else
file_name_prefix = '.ht'
end
%>
<Files ~ "^<%= file_name_prefix %>">
<% if node['apache']['version'] == '2.2' -%>
Order allow,deny
Deny from all
Expand Down

0 comments on commit 6cb7d79

Please sign in to comment.