Skip to content

Commit

Permalink
Add Apache HTTP include
Browse files Browse the repository at this point in the history
  • Loading branch information
jkphl committed Jan 27, 2018
1 parent b6e0db1 commit 35569c2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Admin/Infrastructure/Templates/apache_vhost_http.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<IfModule mod_rewrite.c>
RewriteEngine On

# Redirect all traffic to the main domain (if not in development mode)
RewriteCond %{ENV:APP_ENV} !development
RewriteCond %{HTTP_HOST} !^{{primary_domain_pcre}}$ [NC]
RewriteCond %{REQUEST_URI} !^/\.well\-known
RewriteRule ^ https://{{primary_domain}}%{REQUEST_URI} [L,R=301]

# Redirect all non-SSL traffic to SSL (if not in development mode)
RewriteCond %{ENV:APP_ENV} !development
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^{{primary_domain_pcre}}$ [NC]
RewriteCond %{REQUEST_URI} !^/\.well\-known
RewriteRule ^ https://{{primary_domain}}%{REQUEST_URI} [L,R=301]
</IfModule>

0 comments on commit 35569c2

Please sign in to comment.