Advertisement
Guest User

Error htaccess

a guest
Oct 12th, 2013
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.61 KB | None | 0 0
  1. # IE Chrome frame
  2. # ------------------------------------------------
  3. <IfModule mod_headers.c>
  4. Header set X-UA-Compatible "IE=Edge,chrome=1"
  5. <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" >
  6. Header unset X-UA-Compatible
  7. </FilesMatch>
  8. </IfModule>
  9.  
  10.  
  11. # CORS-enabled images (@crossorigin)
  12. # ------------------------------------------------
  13. <IfModule mod_setenvif.c>
  14. <IfModule mod_headers.c>
  15. # mod_headers, y u no match by Content-Type?!
  16. <FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$">
  17. SetEnvIf Origin ":" IS_CORS
  18. Header set Access-Control-Allow-Origin "*" env=IS_CORS
  19. </FilesMatch>
  20. </IfModule>
  21. </IfModule>
  22.  
  23.  
  24. # Webfont access
  25. # ------------------------------------------------
  26. <IfModule mod_headers.c>
  27. <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
  28. Header set Access-Control-Allow-Origin "*"
  29. </FilesMatch>
  30. </IfModule>
  31.  
  32.  
  33. # Proper MIME type for all files
  34. # ------------------------------------------------
  35. # JavaScript
  36. AddType application/javascript js
  37.  
  38. # Audio
  39. AddType audio/ogg oga ogg
  40. AddType audio/mp4 m4a
  41.  
  42. # Video
  43. AddType video/ogg ogv
  44. AddType video/mp4 mp4 m4v
  45. AddType video/webm webm
  46.  
  47. # SVG
  48. AddType image/svg+xml svg svgz
  49. AddEncoding gzip svgz
  50.  
  51. # Webfonts
  52. AddType application/vnd.ms-fontobject eot
  53. AddType application/x-font-ttf ttf ttc
  54. AddType font/opentype otf
  55. AddType application/x-font-woff woff
  56.  
  57. # Assorted types
  58. AddType image/x-icon ico
  59. AddType image/webp webp
  60. AddType text/cache-manifest appcache manifest
  61. AddType text/x-component htc
  62. AddType application/x-chrome-extension crx
  63. AddType application/x-opera-extension oex
  64. AddType application/x-xpinstall xpi
  65. AddType application/octet-stream safariextz
  66. AddType application/x-web-app-manifest+json webapp
  67. AddType text/x-vcard vcf
  68.  
  69.  
  70.  
  71. # Gzip compression
  72. # ------------------------------------------------
  73. <IfModule mod_deflate.c>
  74. <IfModule mod_setenvif.c>
  75. <IfModule mod_headers.c>
  76. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  77. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  78. </IfModule>
  79. </IfModule>
  80. <IfModule mod_filter.c>
  81. AddOutputFilterByType DEFLATE application/atom+xml \
  82. application/javascript \
  83. application/json \
  84. application/rss+xml \
  85. application/vnd.ms-fontobject \
  86. application/x-font-ttf \
  87. application/xhtml+xml \
  88. application/xml \
  89. font/opentype \
  90. image/svg+xml \
  91. image/x-icon \
  92. text/css \
  93. text/html \
  94. text/plain \
  95. text/x-component \
  96. text/xml
  97. </IfModule>
  98. </IfModule>
  99.  
  100.  
  101. # Expires headers
  102. # ------------------------------------------------
  103. <IfModule mod_expires.c>
  104. ExpiresActive on
  105. ExpiresDefault "access plus 1 month"
  106. ExpiresByType text/cache-manifest "access plus 0 seconds"
  107. ExpiresByType text/html "access plus 0 seconds"
  108. ExpiresByType text/xml "access plus 0 seconds"
  109. ExpiresByType application/xml "access plus 0 seconds"
  110. ExpiresByType application/json "access plus 0 seconds"
  111. ExpiresByType application/rss+xml "access plus 1 hour"
  112. ExpiresByType application/atom+xml "access plus 1 hour"
  113. ExpiresByType image/x-icon "access plus 1 week"
  114. ExpiresByType image/gif "access plus 1 month"
  115. ExpiresByType image/png "access plus 1 month"
  116. ExpiresByType image/jpg "access plus 1 month"
  117. ExpiresByType image/jpeg "access plus 1 month"
  118. ExpiresByType video/ogg "access plus 1 month"
  119. ExpiresByType audio/ogg "access plus 1 month"
  120. ExpiresByType video/mp4 "access plus 1 month"
  121. ExpiresByType video/webm "access plus 1 month"
  122. ExpiresByType text/x-component "access plus 1 month"
  123. ExpiresByType application/x-font-ttf "access plus 1 month"
  124. ExpiresByType font/opentype "access plus 1 month"
  125. ExpiresByType application/x-font-woff "access plus 1 month"
  126. ExpiresByType image/svg+xml "access plus 1 month"
  127. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  128. ExpiresByType text/css "access plus 1 year"
  129. ExpiresByType application/javascript "access plus 1 year"
  130. </IfModule>
  131.  
  132.  
  133. # ETag removal
  134. # ------------------------------------------------
  135. <IfModule mod_headers.c>
  136. Header unset ETag
  137. </IfModule>
  138. FileETag None
  139.  
  140.  
  141. # Start rewrite engine
  142. # ------------------------------------------------
  143. <IfModule mod_rewrite.c>
  144. Options +FollowSymlinks
  145. RewriteEngine On
  146. </IfModule>
  147.  
  148.  
  149. # Suppress or force the "www." at the beginning of URLs
  150. # ------------------------------------------------
  151. <IfModule mod_rewrite.c>
  152. RewriteCond %{HTTPS} !=on
  153. RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  154. RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
  155. </IfModule>
  156.  
  157.  
  158. # Custom 404 page
  159. # ------------------------------------------------
  160. ErrorDocument 404 /404.html
  161.  
  162.  
  163. # UTF-8 encoding
  164. # ------------------------------------------------
  165. AddDefaultCharset utf-8
  166. AddCharset utf-8 .atom .css .js .json .rss .vtt .xml
  167.  
  168.  
  169. # Security
  170. # ------------------------------------------------
  171. <IfModule mod_autoindex.c>
  172. Options -Indexes
  173. </IfModule>
  174. <IfModule mod_rewrite.c>
  175. RewriteCond %{SCRIPT_FILENAME} -d
  176. RewriteCond %{SCRIPT_FILENAME} -f
  177. RewriteRule "(^|/)\." - [F]
  178. </IfModule>
  179. <FilesMatch "(\.(bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist)|~)$">
  180. Order allow,deny
  181. Deny from all
  182. Satisfy All
  183. </FilesMatch>
  184. <IfModule php5_module>
  185. php_value session.cookie_httponly true
  186. </IfModule>
  187.  
  188. RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]
  189. RewriteCond %{QUERY_STRING} ^(.*)=http [NC]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement