Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
92 lines (80 sloc) 4.09 KB
<VirtualHost *:80>
DocumentRoot /var/www/vhosts/myawesomewebsite.com/public_html/web
ServerName myawesomewebsite.com
<Directory /var/www/vhosts/myawesomewebsite.com/public_html/web/>
Options -Indexes +FollowSymLinks +MultiViews
# --------------------------------------
# Speed up apache by disabling .htaccess
# --------------------------------------
AllowOverride None
# Apache 2.2 configuration:
#Order allow,deny
#Allow from all
# Apache 2.4 configuration:
Require all granted
ErrorDocument 404 /
IndexIgnore *
# Some security
<IfModule mod_headers.c>
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.
# It's usually enabled by default anyway, so the role of this header is to re-enable the filter for
# this particular website if it was disabled by the user.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
Header set X-XSS-Protection "1; mode=block"
# Les navigateurs Internet Explorer et Chrome disposent d'une fonctionnalité dite de "MIME-Type sniffing",
# qui consiste à détecter automatiquement le type d'une ressource web.
# Ainsi, une ressource déclarée comme étant une image pourra être interprétée
# comme un script si tel est son contenu.
# Une personne malveillante pourrait profiter d'un envoi de fichier
# sur votre site par exemple pour injecter du code malveillant.
# Nous vous conseillons de désactiver le MIME-Type sniffing pour
# limiter les effets de l'envoi d'un tel fichier.
Header set X-Content-Type-Options "nosniff"
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
Header set X-Frame-Options "SAMEORIGIN"
</IfModule>
# ------------------------------------
# EXPIRES CACHING
# ------------------------------------
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType application/x-font-opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresDefault "access plus 2 days"
</IfModule>
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
# Redirect to www
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
</Directory>
<Directory /var/www/vhosts/myawesomewebsite.com/public_html/web/themes/>
<Files ~ "^\.php|yml|twig|xlf|rzn|rzt|rzg">
# Apache 2.2 configuration:
#Order allow,deny
#Deny from all
# Apache 2.4 configuration:
Require all denied
</Files>
</Directory>
</VirtualHost>
You can’t perform that action at this time.