-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtaccess.txt
More file actions
136 lines (136 loc) · 5.12 KB
/
htaccess.txt
File metadata and controls
136 lines (136 loc) · 5.12 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
##
# @package MiMFa aseqbase
# @copyright Copyright (C) 2005 - 2023 Open Source Matters. All rights reserved.
# @license GNU General Public License version 3 or later; see LICENSE.txt
##
AddDefaultCharset UTF-8
AddCharset utf-8 .html .css .js .xml .json .rss
AddType application/x-font-woff .woff
##
#
# Remove the ETag (entity tag) response header field
Header unset ETag
FileETag none
#
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType video/webm "access 1 year"
ExpiresByType application/x-shockwave-flash "access 1 year"
ExpiresByType application/x-javascript "access 1 year"
ExpiresByType application/javascript "access 1 year"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/woff "access 1 year"
ExpiresByType application/eot "access 1 year"
ExpiresByType text/javascript "access 1 year"
ExpiresByType text/css "access 1 year"
ExpiresDefault "access plus 7 days"
</IfModule>
#
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|gif|jpg|jpeg|png|swf|webm|webp)$">
Header append Cache-Control "public"
</FilesMatch>
<FilesMatch "\.(txt|html)$">
Header append Cache-Control "proxy-revalidate"
</FilesMatch>
<FilesMatch "\.(php|cgi|pl|htm|xml)$">
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>
</IfModule>
#
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
Header append Vary User-Agent env=!dont-vary
</IfModule>
#
# Block/Forbid Referer Spammers/Referer Phishing
RewriteCond %{HTTP_REFERER} ^.*(ranksonic\.|semalt\.|kambasoft\.|buttons-for-website\.|buttons-for-your-website\.com|4webmasters\.org|social-buttons\.com|best-seo-offer\.com|best-seo-solution\.com).*$ [NC]
RewriteRule ^(.*)$ - [F]
#
<files wp-config.php>
order allow,deny
deny from all
</files>
<files "xmlrpc.php">
order allow,deny
deny from all
</files>
<files .htaccess>
order allow,deny
deny from all
</files>
#
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^msnbot
RewriteRule ^.* - [F,L]
#
#Alternate default index pages
DirectoryIndex index.php index.htm index.html static.php
# No directory listings
IndexIgnore *
# Can be commented out if it causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes
# Mod_rewrite in use.
RewriteEngine on
#RewriteBase /
#
## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site then comment out the operations listed
# below by adding a # to the beginning of the line.
# This attempts to block the most common type of exploit `attempts` on MiMFa!
#
# Block any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root home page
RewriteRule .* /index.php [F]
## End - Rewrite rules to block out some common exploits.
#
## Begin - MiMFa! core SEF Section.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# If the requested path and file are not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file don't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file don't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# Redirect all virtual paths to the main index.php
RewriteRule ^ /index.php [L]
## End - MiMFa! core SEF Section.