-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_.htaccess
109 lines (90 loc) · 3.3 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
##############################################
# Caching
##############################################
<IfModule mod_headers.c>
# Header set Cache-Control "no-cache, no-store, must-revalidate"
# Header set Pragma "no-cache"
# Header set Expires 0
Header set Cache-Control "private"
# Header set Content-Security-Policy "default-src 'self'"
# Header set X-XSS-Protection "1; mode=block"
# Header set X-Frame-Options "DENY"
</IfModule>
##############################################
# Force HTTPS
##############################################
<IfModule rewrite_module>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
##############################################
# Language & HTML extension
##############################################
<IfModule rewrite_module>
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.[a-zA-Z0-9]{3,4}
RewriteCond %{REQUEST_URI} !\.(html|css|js|less|jpg|jpeg|png|gif|md|mdn)$
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ $1.html
RewriteCond %{HTTP:Accept-Language} ^es [NC]
RewriteRule ^$ /es/ [L,R=301]
# else redirect to the English version
RewriteRule ^$ /en/ [L,R=301]
</IfModule>
##############################################
# Language and Charsets
# AllowOverride:
##############################################
AddDefaultCharset UTF-8
# AddCharset UTF-8 .txt .ascii .php .shtml .html .htm .css .js .htc
AddCharset UTF-8 .txt .ascii .html .htm .css .js .json .htc .xml
#DefaultLanguage de-DE
#AddLanguage de-DE .txt .ascii .php .shtml .html .htm .css .js .htc
# webp images mimetype support
AddType image/webp .webp .WEBP
AddType application/wasm wasm
##############################################
# Directory Options
# AllowOverride:
# DirectoryIndex, Options
##############################################
# Options +SymLinksIfOwnerMatch -ExecCGI -Indexes -Includes
Options -ExecCGI -Indexes -Includes
DirectoryIndex index.html
##############################################
# Compress / deflate
# AllowOverride:
# SetOutputFilter
# SetEnvIf, SetEnvIfNoCase
# BrowserMatch
# Header
##############################################
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress because they are
SetEnvIfNoCase Request_URI \.(?:gif|jp?g|png|ico|flv|swf|mp?g|avi|divx|mp?|ogg|wm?|mov|m4)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|zip|tar|tgz|tbz|gz|bz|bz2|bzip|rar|7z)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
##############################################
FileETag INode MTime Size
##############################################
# Error Documents
# AllowOverride:
# ErrorDocument
##############################################
# ErrorDocument NNN /path/to/file or "Message
# Client Request Errors
ErrorDocument 400 /assets/errors/400.html
ErrorDocument 401 /assets/errors/401.html
ErrorDocument 403 /assets/errors/403.html
ErrorDocument 404 /assets/errors/404.html
ErrorDocument 500 /assets/errors/500.html