-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
53 lines (42 loc) · 1.37 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
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
DefaultLanguage nl-NL
AddCharset UTF-8 .html
AddCharset UTF-8 .php
# Preserve bandwidth for PHP enabled servers
<ifmodule mod_php4.c>
php_value zlib.output_compression 16386
</ifmodule>
# Google, FLoC off! (and other privacy headers)
Header set Permissions-Policy "interest-cohort=()"
Header set Referrer-Policy "no-referrer"
Header set X-Content-Type-Options "nosniff"
# Add expire headers (prevents hotlinking)
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "access plus 1 day"
</FilesMatch>
# Compress files
<FilesMatch "\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
# Pretty URLs
Options +FollowSymLinks
RewriteRule ^posts/(.*)$ ./year.php?year=$1
RewriteRule ^post/(.*)/(.*)$ ./post.php?year=$1&id=$2
RewriteRule ^type/(.*)$ ./type.php?type=$1
RewriteRule ^tag/(.*)$ ./tag.php?tag=$1
# Remove .php from filenames
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
# GZip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
# Disable the server signature
ServerSignature Off
# limit file uploads to 100K
LimitRequestBody 102400