-
-
Notifications
You must be signed in to change notification settings - Fork 103
/
.htaccess
92 lines (82 loc) · 2.63 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
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</ifModule>
# Required Rewrite Rule
# We should always hide Sensitive Information
ServerSignature Off
# We should always hide Sensitive Information
# Request Recommended by Mozilla
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
# mod_headers, y u no match by Content-Type?!
<FilesMatch "\.(gif|ico|jpe?g|png|svg|svgz|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
</IfModule>
</IfModule>
# Request Recommended by Mozilla
# Allow Webfont access from other locations. (handy)
<IfModule mod_headers.c>
<FilesMatch "\.(eot|font.css|css|otf|ttc|ttf|woff|woff2)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
# Allow Webfont access from other locations. (handy)
# Prevent 404 Errors for Non-Existing Redirected Folders
Options -MultiViews
ErrorDocument 404 error/index.html
# we also want UTF-8 Encoding
AddDefaultCharset utf-8
# Disallow users to view folders with no content
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
<FilesMatch "(\.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|swp)|~)$">
Require all denied
</FilesMatch>
# Prevent 404 Errors for Non-Existing Redirected Folders
# We also want to compress / minify CSS, Images, Remove HTML Whitespace and Comments
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedEnableFilters rewrite_css,combine_css
ModPagespeedEnableFilters recompress_images
ModPagespeedEnableFilters convert_png_to_jpeg,convert_jpeg_to_webp
ModPagespeedEnableFilters collapse_whitespace,remove_comments
</IfModule>
# We also want to compress / minify CSS, Images, Remove HTML Whitespace and Comments
# Headers Module start
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|xml|gz|html|ttf)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
# Headers Module end
# Gzip Compression start
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
# Gzip Compression end
# Keep Alive start
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>
# Keep Alive end
# ETag start
<IfModule mod_expires.c>
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
</IfModule>
# ETag end