# Redirect www subdomain to non-www
RewriteEngine On
# Get protocol
RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ - [env=proto:https]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ - [env=proto:http]
# Rewrite to proto://www-less-host/location
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ %{ENV:proto}://%1$1 [R=301,L]
# The normal virtual host for this specific site
ServerName publiccode.eu
ServerAlias www.publiccode.eu
ServerAlias localhost
ServerAdmin contact@fsfe.org
DocumentRoot /app
Options FollowSymLinks Includes
AllowOverride All
Require all granted