-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
executable file
·45 lines (38 loc) · 1.29 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
# User-Agent kısıtlaması
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* - [F,L]
# Belirli dosya türleri için önbellekleme
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
Header set Cache-Control "max-age=2628000, public"
</filesMatch>
# Dizin listelemeyi devre dışı bırakma
Options -Indexes
# Gzip sıkıştırma
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript
</IfModule>
# Önbellekleme ayarları
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
</IfModule>
# UTF-8 karakter kodlaması
<IfModule mod_mime.c>
AddCharset utf-8 .html .css .js
</IfModule>
# Belirli dosya türlerinin erişimini engelleme
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|sql)$">
Order allow,deny
Deny from all
</FilesMatch>
# HTTPS yönlendirmesi
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>