Advertisement
Guest User

Untitled

a guest
Sep 4th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. Options -Indexes
  2. Options +FollowSymLinks
  3. AddDefaultCharset Off
  4. #UTF-8
  5. # Customized error messages.
  6. ErrorDocument 404 /index.php
  7. # Set the default handler.
  8. DirectoryIndex index.php
  9. # обеспечивающие при необходимости большею безопасность для скриптов php:
  10. php_value magic_quotes_gpc on
  11. php_flag register_globals off
  12.  
  13. <IfModule mod_rewrite.c>
  14. RewriteEngine on
  15. # Rewrite current-style URLs of the form 'index.php?q=x'.
  16. RewriteBase /
  17. RewriteCond %{REQUEST_FILENAME} !-f
  18. RewriteCond %{REQUEST_FILENAME} !-d
  19. RewriteRule ^(.*)$ index.php?page=$1 [QSA,L]
  20. # RewriteRule ^(site*)/(0,1)$site.php?detail=$1
  21. # RewriteRule ^(site+)/([a-z]+)/([0-9]+)/({0,1})$site.php?&detail=$1&CategoryID=$2&TypeID=$3
  22. </IfModule>
  23.  
  24. RewriteEngine On
  25. RewriteBase /
  26. RewriteRule ^.htaccess$ -[F]
  27. RewriteRule ^rss.xml$ rss.php
  28. AddEncoding gzip .gz
  29.  
  30. #Усиливаем кеширование
  31. FileETag MTime Size
  32. <ifmodule mod_expires.c>
  33. <filesmatch ".(jpg|gif|png|css|js)$">
  34. ExpiresActive on
  35. ExpiresDefault "access plus 10 year"
  36. </filesmatch>
  37. </ifmodule>
  38. #Сжимаем компоненты сайта путем включения Gzip
  39. AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
  40. BrowserMatch ^Mozilla/4 gzip-only-text/html
  41. BrowserMatch ^Mozilla/4.0[678] no-gzip
  42. BrowserMatch bMSIE !no-gzip !gzip-only-text/html
  43.  
  44. RewriteCond %{HTTP:Accept-encoding} gzip
  45. RewriteCond %{HTTP_USER_AGENT} !Konqueror
  46. RewriteCond %{REQUEST_FILENAME}.gz -f
  47. RewriteRule ^(.*)\.css$ $1.css.gz [QSA,L]
  48. <FilesMatch \.css\.gz$>
  49. ForceType text/css
  50. </FilesMatch>
  51. RewriteCond %{HTTP:Accept-encoding} gzip
  52. RewriteCond %{HTTP_USER_AGENT} !Konqueror
  53. RewriteCond %{REQUEST_FILENAME}.gz -f
  54. RewriteRule ^(.*)\.js$ $1.js.gz [QSA,L]
  55.  
  56. <FilesMatch \.js\.gz$>
  57. ForceType application/x-javascript
  58. </FilesMatch>
  59. ExpiresActive On
  60. ExpiresDefault "access plus 10 years"
  61. <FilesMatch \.(php|phtml|shtml|html|xml)$>
  62. ExpiresActive Off
  63. </FilesMatch>
  64. <FilesMatch \.(php|phtml|shtml|html|xml)$>
  65. Header append Vary User-Agent
  66. Header append Cache-Control private
  67. </FilesMatch>
  68. <FilesMatch \.(bmp|png|gif|jpeg|ico|flv|wmf|swf|pdf|doc|rtf|css|js)$>
  69. Header append Cache-Control public
  70. </FilesMatch>
  71. <FilesMatch \.(js|css|bmp|png|gif|jpeg|ico|flv|wmf|swf|pdf|doc|rtf)$>
  72. Header unset Last-Modified
  73. FileETag MTime
  74. </FilesMatch>
  75.  
  76. ExpiresByType image/jpeg "access plus 333 day"
  77. ExpiresByType image/gif "access plus 333 day"
  78. ExpiresByType image/png "access plus 333 day"
  79. ExpiresByType application/x-javascript "access plus 333 day"
  80. ExpiresByType text/css "access plus 333 day"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement