-
Notifications
You must be signed in to change notification settings - Fork 5
/
.htaccess
75 lines (64 loc) · 2.56 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
Options -Indexes
ErrorDocument 404 /404.php
<IfModule mod_php7.c>
#php_flag allow_call_time_pass_reference 1
#php_flag session.use_trans_sid off
#php_value display_errors 1
#php_value mbstring.internal_encoding UTF-8
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
#del //
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
RewriteRule (.*) %1/%2 [R=301,L]
#del www
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
#change
RewriteCond %{REQUEST_URI} ^(.*/[^/\.]+)$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1/ [R=301,L]
#only https
RewriteCond %{HTTPS} =off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#replace
#RewriteCond %{REQUEST_URI} ^(.*)/$
#RewriteRule .* - [L]
#RewriteCond %{ENV:REDIRECT_STATUS} 200
#RewriteRule .* - [L]
#RewriteCond %{REQUEST_METHOD} =GET
#RewriteCond %{REQUEST_URI} ^(.*)/index.php$
#RewriteRule ^(.*)$ %1/ [R=301,L]
#replace index
RewriteRule ^(.*)index\.(html|htm?)$ /$1 [R=301,NC,L]
#bitrix
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<ifModule mod_expires.c>
ExpiresActive On
#по умолчанию кеш на 5 секунд
ExpiresDefault "access plus 5 seconds"
#кэшируем флэш и изображения на месяц
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType image/jpeg "access plus 4 weeks"
ExpiresByType image/png "access plus 30 days"
ExpiresByType image/gif "access plus 43829 minutes"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
#кэшируем CSS, JavaScript и текстовые файлы на одну неделю
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType application/x-javascript "access plus 604800 seconds"
#кэшируем HTML и HTM файлы на один день
ExpiresByType text/html "access plus 43200 seconds"
#кэшируем XML файлы на десять минут
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>