Blame view

.htaccess 3.88 KB
61f6789b   Yarik   htaccess
1
  Options FollowSymLinks

3bc9af21   Yarik   Layout
2
  AddDefaultCharset utf-8

3bc9af21   Yarik   Layout
3
4
  

  <IfModule mod_rewrite.c>

61f6789b   Yarik   htaccess
5
      RewriteEngine On

3bc9af21   Yarik   Layout
6
  

61f6789b   Yarik   htaccess
7
8
9
      #  main rewrite rule for the frontend application

      RewriteCond %{REQUEST_URI} !^/(backend/web|admin)

      RewriteRule !^frontend/web /frontend/web%{REQUEST_URI} [L]

3bc9af21   Yarik   Layout
10
  

61f6789b   Yarik   htaccess
11
12
13
14
15
16
      #  to the page without a trailing slash (uncomment if necessary)

      #RewriteCond %{REQUEST_URI} ^/admin/$

      #RewriteRule ^(admin)/ /$1 [L,R=301]

      #  main rewrite rule for the backend application

      RewriteCond %{REQUEST_URI} ^/admin

      RewriteRule ^admin(.*) /backend/web/$1 [L]

3bc9af21   Yarik   Layout
17
  

61f6789b   Yarik   htaccess
18
19
20
      #  a directory or a file of the frontend application exists, use the request directly

      RewriteCond %{REQUEST_URI} ^/frontend/web

      RewriteCond %{REQUEST_FILENAME} !-f

3bc9af21   Yarik   Layout
21
      RewriteCond %{REQUEST_FILENAME} !-d

61f6789b   Yarik   htaccess
22
23
      #  forward the request to index.php

      RewriteRule . /frontend/web/index.php [L]

3bc9af21   Yarik   Layout
24
  

61f6789b   Yarik   htaccess
25
26
27
28
29
30
      #  a directory or a file of the backend application exists, use the request directly

      RewriteCond %{REQUEST_URI} ^/backend/web

      RewriteCond %{REQUEST_FILENAME} !-f

      RewriteCond %{REQUEST_FILENAME} !-d

      #  forward the request to index.php

      RewriteRule . /backend/web/index.php [L]

3bc9af21   Yarik   Layout
31
  

61f6789b   Yarik   htaccess
32
33
      RewriteCond %{REQUEST_URI} \.(htaccess|htpasswd|svn|git)

      RewriteRule \.(htaccess|htpasswd|svn|git) - [F]

3bc9af21   Yarik   Layout
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
  </IfModule>

  

  #для возможности загрузки файлов парсера

  <IfModule mod_php5.c>

       upload_max_filesize 20M

       post_max_size 30M

  </IfModule>

  

  

  # кеширование в браузере на стороне пользователя

  #

  #<IfModule mod_expires.c>

  # ExpiresActive On

  # ExpiresDefault "access 7 days"

  # ExpiresByType application/javascript "access plus 1 year"

  # ExpiresByType text/javascript "access plus 1 year"

  # ExpiresByType text/css "access plus 1 year"

  # ExpiresByType text/html "access plus 7 day"

  # ExpiresByType text/x-javascript "access 1 year"

  # ExpiresByType image/gif "access plus 1 year"

  # ExpiresByType image/jpeg "access plus 1 year"

  # ExpiresByType image/png "access plus 1 year"

  # ExpiresByType image/jpg "access plus 1 year"

  # ExpiresByType image/x-icon "access 1 year"

  # ExpiresByType application/x-shockwave-flash "access 1 year"

  # </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

  #BrowserMatch ^Mozilla/4 gzip-only-text/html

  #BrowserMatch ^Mozilla/4\.0[678] no-gzip

  #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

  #Header append Vary User-Agent

  #RewriteEngine On

  #AddEncoding gzip .gz

  #RewriteCond %{HTTP:Accept-encoding} gzip

  #RewriteCond %{REQUEST_FILENAME}.gz -f

  #RewriteRule ^(.*)$ $1.gz [QSA,L]

  #</IfModule>

  ## -Control

  #< mod_headers.c>

  ##  дней

  #    < "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">

  #    Header set Cache-Control "max-age=2592000, public"

  #    </>

  #    #  дней

  #    < "\.(css|js)$">

  #    Header set Cache-Control "max-age=2592000, public"

  #    </>

  #    #  дня

  #    < "\.(xml|txt)$">

  #    Header set Cache-Control "max-age=172800, public, must-revalidate"

  #    </>

  #    #  день

  #    < "\.(html|htm|php)$">

  #    Header set Cache-Control "max-age=172800, private, must-revalidate"

  #    </>

  #</>

  #

  ##Запрет отдачи -заголовков Vary браузерам семейства MSIE

  #<IfModule mod_setenvif.c>

  #BrowserMatch "MSIE" force-no-vary

  #BrowserMatch "Mozilla/4.[0-9]{2}" force-no-vary

  #</IfModule>