-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
32 lines (27 loc) · 1.45 KB
/
.htaccess
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
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE "application/atom+xml" "application/javascript" "application/json" "application/ld+json" "application/manifest+json" "application/rdf+xml" "application/rss+xml" "application/schema+json" "application/vnd.geo+json" "application/vnd.ms-fontobject" "application/x-font-ttf" "application/x-javascript" "application/x-web-app-manifest+json" "application/xhtml+xml" "application/xml" "font/eot" "font/opentype" "image/bmp" "image/svg+xml" "image/vnd.microsoft.icon" "image/x-icon" "text/cache-manifest" "text/css" "text/html" "text/javascript" "text/plain" "text/vcard" "text/vnd.rim.location.xloc" "text/vtt" "text/x-component" "text/x-cross-domain-policy" "text/xml"
# SECTION BEGIN GIT PROTECTION
RedirectMatch 404 /\.git
# SECTION END GIT PROTECTION
# Remove www from url
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]
# Redirecting HTTP to HTTPS
RewriteCond %{HTTP_HOST} ^designcommun\.fr [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://designcommun.fr/$1 [R,L]
# Enable Keep-Alive
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
# Cache settings
# One year for image files
<filesMatch ".(jpg|jpeg|png|gif|ico)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>
# One month = 2628000
# 200 seconds for css and js
<filesMatch ".(css|js)$">
Header set Cache-Control "max-age=200, public"
</filesMatch>