Header append Vary Accept env=REDIRECT_accept
AddType image/webp .webp
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_URI} (.*)(\.(jpe?g|png))$
RewriteCond %{DOCUMENT_ROOT}/%1\_webp.webp -f
RewriteRule .* %1_webp\.webp [L,T=image/webp]
RewriteEngine On
RewriteCond %{REQUEST_URI} (.*)(\.(jpg))$
RewriteCond %{DOCUMENT_ROOT}/%1_jpg\.jpg -f
RewriteRule .* %1_jpg\.jpg [L,T=image/jpg]
RewriteEngine On
RewriteCond %{REQUEST_URI} (.*)(\.(png))$
RewriteCond %{DOCUMENT_ROOT}/%1_png\.png -f
RewriteRule .* %1_png\.png [L,T=image/png]
RewriteEngine on
Options +FollowSymlinks
RewriteRule ^(.*).md index.php [L]
RewriteRule ^config.php$ index.php [L]
RewriteRule ^robots.txt$ index.php [L]
RewriteRule ^sitemap.xml$ index.php [L]
RewriteRule ^yml.xml$ index.php [L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ https://%1/$1 [L,R=301]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_URI} !(.*)/$
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.+[^/])$ /$1/ [R=301,L]
#RewriteRule ^api/?([^/]+)?/?([^/]+)?/$ module/api.php?module=$1&action=$2&%{QUERY_STRING} [L]
RewriteRule ^api/([^/]+)?/?([^/]+)?/$ index.php?api=1&module=$1&action=$2&%{QUERY_STRING} [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php?%{QUERY_STRING} [L]
AddType application/x-javascript .js
#AddType application/octet-stream .docx .mov .pdf .xlsx
AddType application/vnd.ms-word.document.macroEnabled.12 docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
#--------------------
# force deflate for mangled headers
# developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
# Legacy versions of Apache
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
# FileETag None is not enough for every server.
Header unset ETag
# Since we`re sending far-future expires, we don't need ETags for static content.
# developer.yahoo.com/performance/rules.html#etags
FileETag None
# ----------------------------------------------------------------------
# Кроссдоменные изображения (CORS-enabled images) (@crossorigin)
# ----------------------------------------------------------------------
# Отсылать CORS заголовки, если браузер требует их, для изображений по умолчанию включено.
# http://developer.mozilla.org/en/CORS_Enabled_Image
# http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
# http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
# wiki.mozilla.org/Security/Reviews/crossoriginAttribute
# mod_headers, ну почему ты не определяешь Content-Type?!
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
# ----------------------------------------------------------------------
# Задаем Expires заголовки (срок актуальности файла) (для лучшего кэширования)
# ----------------------------------------------------------------------
# Указываются заголовки с большим сроком "годности",
# предполагается, что вы используете кэш на основе названий файлов (all.css?v001).
# В дополнение, учтите, что старые прокси могут кэшировать не верно
# http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# Если вы не используете названия файлов для контроля версий, измените кэш для CSS и JS, например на
# "access plus 1 week".
ExpiresActive on
# Задаем значение по умолчанию (для всех файлов)
ExpiresDefault "access plus 1 month"
# cache.appcache нельзя кэшировать в FF 3.6 (спасибо Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Ваш html документ
ExpiresDefault "access plus 0 seconds"
ExpiresByType text/html "access plus 0 seconds"
# Данные
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# Рассылка
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/atom+xml "access plus 1 hour"
# Favicon (не может быть переименован)
ExpiresDefault "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 week"
# Медиа: изображения, видео, аудио
ExpiresDefault "access plus 1 year"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
# HTC файлы (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# Веб-шрифты
ExpiresDefault "access plus 1 year"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# CSS и JavaScript
ExpiresDefault "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
# Статичные ресурсы
ExpiresDefault "access plus 1 year"
ExpiresByType application/x-shockwave-flash "access plus 1 year"
ExpiresByType application/pdf "access plus 1 year"
ExpiresByType application/msword "access plus 1 year"
ExpiresByType application/rtf "access plus 1 year"
ExpiresByType application/vnd.ms-excel "access plus 1 year"
ExpiresByType application/vnd.ms-powerpoint "access plus 1 year"