Advertisement
Sceko

.htaccess

Nov 7th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.78 KB | None | 0 0
  1. # BEGIN WordPress
  2. <IfModule mod_rewrite.c>
  3. RewriteEngine On
  4. RewriteBase /
  5. RewriteRule ^index\.php$ - [L]
  6. RewriteCond %{REQUEST_FILENAME} !-f
  7. RewriteCond %{REQUEST_FILENAME} !-d
  8. RewriteRule . /index.php [L]
  9. </IfModule>
  10. # END WordPress
  11.  
  12. <files wp-config.php>
  13. order allow,deny
  14. deny from all
  15. </files>
  16.  
  17. <IfModule mod_rewrite.c>
  18. RewriteEngine On
  19. RewriteBase /
  20. RewriteRule ^wp-admin/includes/ - [F,L]
  21. RewriteRule !^wp-includes/ - [S=3]
  22. RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
  23. RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
  24. RewriteRule ^wp-includes/theme-compat/ - [F,L]
  25. </IfModule>
  26.  
  27. <files ~ “^.*\.([Hh][Tt][Aa])”>
  28. order allow,deny
  29. deny from all
  30. satisfy all
  31. </files>
  32.  
  33. # Don't show directory listings for URLs which map to a directory.
  34. Options -Indexes
  35.  
  36. # Follow symbolic links in this directory.
  37. Options +FollowSymLinks
  38.  
  39.  
  40. <IfModule mod_deflate.c>
  41.  
  42. # Force compression for mangled headers.
  43. # https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html
  44. <IfModule mod_setenvif.c>
  45. <IfModule mod_headers.c>
  46. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  47. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  48. </IfModule>
  49. </IfModule>
  50.  
  51. # Compress all output labeled with one of the following MIME-types
  52. # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
  53. # and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines
  54. # as `AddOutputFilterByType` is still in the core directives).
  55. <IfModule mod_filter.c>
  56. AddOutputFilterByType DEFLATE application/atom+xml \
  57. application/javascript \
  58. application/json \
  59. application/rss+xml \
  60. application/vnd.ms-fontobject \
  61. application/x-font-ttf \
  62. application/x-web-app-manifest+json \
  63. application/xhtml+xml \
  64. application/xml \
  65. font/opentype \
  66. image/svg+xml \
  67. image/x-icon \
  68. text/css \
  69. text/html \
  70. text/plain \
  71. text/x-component \
  72. text/xml
  73. </IfModule>
  74.  
  75. </IfModule>
  76.  
  77. <IfModule mod_gzip.c>
  78. mod_gzip_on Yes
  79. mod_gzip_dechunk Yes
  80. mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
  81. mod_gzip_item_include handler ^cgi-script$
  82. mod_gzip_item_include mime ^text/.*
  83. mod_gzip_item_include mime ^application/x-javascript.*
  84. mod_gzip_item_exclude mime ^image/.*
  85. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  86. </IfModule>
  87.  
  88.  
  89. <IfModule mod_expires.c>
  90. ExpiresActive on
  91. ExpiresDefault "access plus 1 month"
  92.  
  93. # CSS
  94. ExpiresByType text/css "access plus 1 year"
  95.  
  96. # Data interchange
  97. ExpiresByType application/json "access plus 0 seconds"
  98. ExpiresByType application/xml "access plus 0 seconds"
  99. ExpiresByType text/xml "access plus 0 seconds"
  100.  
  101. # Favicon (cannot be renamed!)
  102. ExpiresByType image/x-icon "access plus 1 week"
  103.  
  104. # HTML components (HTCs)
  105. ExpiresByType text/x-component "access plus 1 month"
  106.  
  107. # HTML
  108. ExpiresByType text/html "access plus 0 seconds"
  109.  
  110. # JavaScript
  111. ExpiresByType application/javascript "access plus 1 year"
  112.  
  113. # Manifest files
  114. ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
  115. ExpiresByType text/cache-manifest "access plus 0 seconds"
  116.  
  117. # Media
  118. ExpiresByType audio/ogg "access plus 1 month"
  119. ExpiresByType image/gif "access plus 1 month"
  120. ExpiresByType image/jpeg "access plus 1 month"
  121. ExpiresByType image/png "access plus 1 month"
  122. ExpiresByType video/mp4 "access plus 1 month"
  123. ExpiresByType video/ogg "access plus 1 month"
  124. ExpiresByType video/webm "access plus 1 month"
  125.  
  126. # Web feeds
  127. ExpiresByType application/atom+xml "access plus 1 hour"
  128. ExpiresByType application/rss+xml "access plus 1 hour"
  129.  
  130. # Web fonts
  131. ExpiresByType application/font-woff2 "access plus 1 month"
  132. ExpiresByType application/font-woff "access plus 1 month"
  133. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  134. ExpiresByType application/x-font-ttf "access plus 1 month"
  135. ExpiresByType font/opentype "access plus 1 month"
  136. ExpiresByType image/svg+xml "access plus 1 month"
  137. </IfModule>
  138.  
  139. <IfModule mod_headers.c>
  140. Header unset ETag
  141. </IfModule>
  142. FileETag None
  143.  
  144. <IfModule mod_headers.c>
  145. <FilesMatch ".(js|css|xml|gz|html)$">
  146. Header append Vary: Accept-Encoding
  147. </FilesMatch>
  148. </IfModule>
  149.  
  150. <IfModule pagespeed_module>
  151. ModPagespeed on
  152. ModPagespeedEnableFilters
  153. extend_cache,combine_css,combine_javascript,collapse_whitespace,move_css_to_head
  154. </IfModule>
  155.  
  156. <IfModule mod_headers.c>
  157. Header set Connection keep-alive
  158. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement