File: _redirect.erb

package info (click to toggle)
puppet-module-puppetlabs-apache 12.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,664 kB
  • sloc: ruby: 275; sh: 32; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 1,685 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<% if @redirect_source and @redirect_dest -%>
<% @redirect_dest_a   = Array(@redirect_dest) -%>
<% @redirect_source_a = Array(@redirect_source) -%>
<% @redirect_status_a = Array(@redirect_status) -%>

  ## Redirect rules
  <%- @redirect_source_a.each_with_index do |source, i| -%>
<% @redirect_dest_a[i] ||= @redirect_dest_a[0] -%>
<% @redirect_status_a[i] ||= @redirect_status_a[0] -%>
  Redirect <%= "#{@redirect_status_a[i]} " %><%= source %> <%= @redirect_dest_a[i] %>
  <%- end -%>
<% end -%>
<%- if @redirectmatch_status and @redirectmatch_regexp and @redirectmatch_dest -%>
<% @redirectmatch_status_a = Array(@redirectmatch_status) -%>
<% @redirectmatch_regexp_a = Array(@redirectmatch_regexp) -%>
<% @redirectmatch_dest_a = Array(@redirectmatch_dest) -%>

  ## RedirectMatch rules
  <%- @redirectmatch_status_a.each_with_index do |status, i| -%>
<% @redirectmatch_status_a[i] ||= @redirectmatch_status_a[0] -%>
<% @redirectmatch_regexp_a[i] ||= @redirectmatch_regexp_a[0] -%>
<% @redirectmatch_dest_a[i] ||= @redirectmatch_dest_a[0] -%>
  RedirectMatch <%= "#{@redirectmatch_status_a[i]} " %> <%= @redirectmatch_regexp_a[i] %> <%= @redirectmatch_dest_a[i] %>
  <%- end -%>
<%- elsif @redirectmatch_regexp and @redirectmatch_dest -%>
<% @redirectmatch_regexp_a = Array(@redirectmatch_regexp) -%>
<% @redirectmatch_dest_a = Array(@redirectmatch_dest) -%>

  ## RedirectMatch rules
  <%- @redirectmatch_regexp_a.each_with_index do |status, i| -%>
<% @redirectmatch_regexp_a[i] ||= @redirectmatch_regexp_a[0] -%>
<% @redirectmatch_dest_a[i] ||= @redirectmatch_dest_a[0] -%>
  RedirectMatch <%= @redirectmatch_regexp_a[i] %> <%= @redirectmatch_dest_a[i] %>
  <%- end -%>
<% end -%>