Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <IfModule mod_rewrite.c>
- <IfModule mod_negotiation.c>
- Options -MultiViews
- </IfModule>
- RewriteEngine On
- # Redirect Trailing Slashes If Not A Folder...
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)/$ /$1 [L,R=301]
- # Handle Front Controller...
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^ index.php [L]
- # Handle Authorization Header
- RewriteCond %{HTTP:Authorization} .
- RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
- </IfModule>
- <ifModule mod_headers.c>
- #кэшировать html и htm файлы на один день
- <FilesMatch "\.(html|htm)$">
- Header set Cache-Control "max-age=43200"
- </FilesMatch>
- #кэшировать css, javascript и текстовые файлы на одну неделю
- <FilesMatch "\.(js|css|txt)$">
- Header set Cache-Control "max-age=604800"
- </FilesMatch>
- #кэшировать флэш и изображения на месяц
- <FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$">
- Header set Cache-Control "max-age=2592000"
- </FilesMatch>
- #отключить кэширование
- <FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
- Header unset Cache-Control
- </FilesMatch>
- </IfModule>
- <ifModule mod_expires.c>
- ExpiresActive On
- #по умолчанию кеш в 5 секунд
- ExpiresDefault "access plus 5 seconds"
- #кэшировать флэш и изображения на месяц
- ExpiresByType image/x-icon "access plus 2592000 seconds"
- ExpiresByType image/jpeg "access plus 2592000 seconds"
- ExpiresByType image/png "access plus 2592000 seconds"
- ExpiresByType image/gif "access plus 2592000 seconds"
- 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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement