Skip to content

Commit 03abe35

Browse files
committed
1 parent 811a36a commit 03abe35

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

server/conf/vhost.conf.master

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,15 @@
438438
RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
439439
RewriteRule ^ - [END]
440440
</tmpl_if>
441+
<tmpl_if name='ssl_enabled'>
442+
<tmpl_else>
443+
<tmpl_if name='rewrite_to_https' op='==' value='y'>
444+
RewriteCond %{HTTPS} off
445+
<tmpl_if name='apache_version' op='<' value='2.4' format='version'>RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
446+
</tmpl_if>
447+
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
448+
</tmpl_if>
449+
</tmpl_if>
441450
<tmpl_if name='seo_redirect_enabled'>
442451
RewriteCond %{HTTP_HOST} <tmpl_var name='seo_redirect_operator'>^<tmpl_var name='seo_redirect_origin_domain'>$ [NC]
443452
<tmpl_if name='apache_version' op='<' value='2.4' format='version'>
@@ -466,15 +475,6 @@
466475
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'><tmpl_if name="rewrite_add_path" op="==" value="y">$1</tmpl_if> <tmpl_var name='rewrite_type'>
467476

468477
</tmpl_loop>
469-
<tmpl_if name='ssl_enabled'>
470-
<tmpl_else>
471-
<tmpl_if name='rewrite_to_https' op='==' value='y'>
472-
RewriteCond %{HTTPS} off
473-
<tmpl_if name='apache_version' op='<' value='2.4' format='version'>RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
474-
</tmpl_if>
475-
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
476-
</tmpl_if>
477-
</tmpl_if>
478478
</tmpl_if>
479479

480480
# add support for apache mpm_itk

0 commit comments

Comments
 (0)