Advertisement
Guest User

.htaccess

a guest
Jul 31st, 2013
606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.97 KB | None | 0 0
  1. # RULES
  2. Order Allow,Deny
  3. Allow from all
  4.  
  5. # ERRORS
  6. ErrorDocument 400 http://твой сайт/
  7. ErrorDocument 402 http://твой сайт/
  8. ErrorDocument 403 http://твой сайт/
  9. ErrorDocument 404 http://твой сайт/
  10.  
  11. # OPTIONS
  12. Options -Indexes
  13.  
  14. # REWRITE MOD
  15. RewriteEngine on
  16.  
  17. # URL
  18. RewriteCond %{REQUEST_FILENAME} !-f
  19. RewriteCond %{REQUEST_FILENAME} !-l
  20. RewriteCond %{REQUEST_URI} !index.php
  21. RewriteCond %{REQUEST_URI} !\.[^./]+$
  22. RewriteCond %{REQUEST_URI} !(.*)/$
  23. RewriteRule ^(.*)$ index.php?EX=$1 [L,QSA]
  24. RewriteRule ^(.*)/$ index.php?EX=$1 [L,QSA]
  25.  
  26. # REQUEST LIMIT
  27. LimitRequestBody 2000000
  28.  
  29. # mod_deflate
  30. <IfModule mod_deflate.c>
  31. <FilesMatch ".(ico|css|js|x?html?|php|xml)$">
  32. SetOutputFilter DEFLATE
  33. </FilesMatch>
  34. </IfModule>
  35.  
  36. # mod_gzip
  37. <ifModule mod_gzip.c>
  38. mod_gzip_on Yes
  39. mod_gzip_dechunk Yes
  40. mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
  41. mod_gzip_item_include handler ^cgi-script$
  42. mod_gzip_item_include mime ^text/.*
  43. mod_gzip_item_include mime ^application/x-javascript.*
  44. mod_gzip_item_exclude mime ^image/.*
  45. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  46. </ifModule>
  47.  
  48. # mod_expires
  49. <ifModule mod_expires.c>
  50. ExpiresActive On
  51. ExpiresDefault A0
  52.  
  53. # 1 YEAR - doesn't change often
  54. <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
  55. ExpiresDefault A29030400
  56. </FilesMatch>
  57.  
  58. # 1 WEEK - possible to be changed, unlikely
  59. <FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
  60. ExpiresDefault A604800
  61. </FilesMatch>
  62.  
  63. # 3 HOUR - core content, changes quickly
  64. <FilesMatch "\.(txt|xml|js|css)$">
  65. ExpiresDefault A10800
  66. </FilesMatch>
  67. </ifModule>
  68.  
  69. # mod_headers
  70. <ifModule mod_headers.c>
  71. <filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|swf|bmp)$">
  72. Header set Cache-Control "max-age=604800, public"
  73. </filesMatch>
  74. <filesMatch ".(css|js)$">
  75. Header set Cache-Control "max-age=604800, public"
  76. </filesMatch>
  77. <filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
  78. Header unset ETag
  79. FileETag None
  80. </filesMatch>
  81. </ifModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement