Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.74 KB | None | 0 0
  1. <IfModule mod_setenvif.c>
  2. <IfModule mod_headers.c>
  3. <FilesMatch ".(gif|ico|jpe?g|png|svgz?|webp)$">
  4. SetEnvIf Origin ":" IS_CORS
  5. Header set Access-Control-Allow-Origin "*" env=IS_CORS
  6. </FilesMatch>
  7. </IfModule>
  8. </IfModule>
  9.  
  10. <IfModule mod_headers.c>
  11. <FilesMatch ".(eot|font.css|otf|ttc|ttf|woff)$">
  12. Header set Access-Control-Allow-Origin "*"
  13. </FilesMatch>
  14. </IfModule>
  15.  
  16. Options -MultiViews
  17.  
  18. ErrorDocument 404 /404.html
  19.  
  20.  
  21. <IfModule mod_headers.c>
  22. Header set X-UA-Compatible "IE=edge"
  23. <FilesMatch ".(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svgz?|ttf|vcf|webapp|webm|webp|woff|xml|xpi)$">
  24. Header unset X-UA-Compatible
  25. </FilesMatch>
  26. </IfModule>
  27.  
  28. <IfModule mod_mime.c>
  29.  
  30. # Audio
  31. AddType audio/mp4 m4a f4a f4b
  32. AddType audio/ogg oga ogg
  33.  
  34. # JavaScript
  35. AddType application/javascript js
  36. AddType application/json json
  37.  
  38. # Video
  39. AddType video/mp4 mp4 m4v f4v f4p
  40. AddType video/ogg ogv
  41. AddType video/webm webm
  42. AddType video/x-flv flv
  43.  
  44. # Web fonts
  45. AddType application/font-woff woff
  46. AddType application/vnd.ms-fontobject eot
  47.  
  48. AddType application/x-font-ttf ttc ttf
  49. AddType font/opentype otf
  50. AddType image/svg+xml svg svgz
  51. AddEncoding gzip svgz
  52.  
  53.  
  54. AddType application/octet-stream safariextz
  55. AddType application/x-chrome-extension crx
  56. AddType application/x-opera-extension oex
  57. AddType application/x-shockwave-flash swf
  58. AddType application/x-web-app-manifest+json webapp
  59. AddType application/x-xpinstall xpi
  60. AddType application/xml atom rdf rss xml
  61. AddType image/webp webp
  62. AddType image/x-icon ico
  63. AddType text/cache-manifest appcache manifest
  64. AddType text/vtt vtt
  65. AddType text/x-component htc
  66. AddType text/x-vcard vcf
  67.  
  68. </IfModule>
  69.  
  70. AddDefaultCharset utf-8
  71.  
  72. # Force UTF-8 for certain file formats.
  73. <IfModule mod_mime.c>
  74. AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml
  75. </IfModule>
  76.  
  77. <IfModule mod_rewrite.c>
  78. Options +FollowSymlinks
  79. RewriteEngine On
  80. RewriteBase /
  81.  
  82. RewriteRule ^index.php$ - [L]
  83. RewriteCond %{REQUEST_FILENAME} !-f
  84. RewriteCond %{REQUEST_FILENAME} !-d
  85. RewriteRule . /index.php [L]
  86.  
  87.  
  88. </IfModule>
  89.  
  90. <IfModule mod_rewrite.c>
  91. RewriteCond %{HTTPS} !=on
  92. RewriteCond %{HTTP_HOST} !^www..+$ [NC]
  93. RewriteCond %{HTTP_HOST} !=localhost [NC]
  94. RewriteCond %{HTTP_HOST} !=127.0.0.1
  95. RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  96. </IfModule>
  97.  
  98.  
  99. <IfModule mod_autoindex.c>
  100. Options -Indexes
  101. </IfModule>
  102.  
  103.  
  104. <IfModule mod_rewrite.c>
  105. RewriteCond %{SCRIPT_FILENAME} -d [OR]
  106. RewriteCond %{SCRIPT_FILENAME} -f
  107. RewriteRule "(^|/)." - [F]
  108. </IfModule>
  109.  
  110. <FilesMatch "(^#.*#|.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|sw[op])|~)$">
  111. Order allow,deny
  112. Deny from all
  113. Satisfy All
  114. </FilesMatch>
  115.  
  116. <IfModule mod_deflate.c>
  117.  
  118. <IfModule mod_setenvif.c>
  119. <IfModule mod_headers.c>
  120. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)s*,?s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  121. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  122. </IfModule>
  123. </IfModule>
  124.  
  125. <IfModule mod_filter.c>
  126. AddOutputFilterByType DEFLATE application/atom+xml
  127. application/javascript
  128. application/json
  129. application/rss+xml
  130. application/vnd.ms-fontobject
  131. application/x-font-ttf
  132. application/x-web-app-manifest+json
  133. application/xhtml+xml
  134. application/xml
  135. font/opentype
  136. image/svg+xml
  137. image/x-icon
  138. text/css
  139. text/html
  140. text/plain
  141. text/x-component
  142. text/xml
  143. </IfModule>
  144.  
  145. </IfModule>
  146.  
  147. # `FileETag None` is not enough for every server.
  148. <IfModule mod_headers.c>
  149. Header unset ETag
  150. </IfModule>
  151.  
  152. FileETag None
  153.  
  154.  
  155. <IfModule mod_expires.c>
  156.  
  157. ExpiresActive on
  158. ExpiresDefault "access plus 1 month"
  159.  
  160. # CSS
  161. ExpiresByType text/css "access plus 1 year"
  162.  
  163. # Data interchange
  164. ExpiresByType application/json "access plus 0 seconds"
  165. ExpiresByType application/xml "access plus 0 seconds"
  166. ExpiresByType text/xml "access plus 0 seconds"
  167.  
  168. # Favicon (cannot be renamed!)
  169. ExpiresByType image/x-icon "access plus 1 week"
  170.  
  171. # HTML components (HTCs)
  172. ExpiresByType text/x-component "access plus 1 month"
  173.  
  174. # HTML
  175. ExpiresByType text/html "access plus 0 seconds"
  176.  
  177. # JavaScript
  178. ExpiresByType application/javascript "access plus 1 year"
  179.  
  180. # Manifest files
  181. ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
  182. ExpiresByType text/cache-manifest "access plus 0 seconds"
  183.  
  184. # Media
  185. ExpiresByType audio/ogg "access plus 1 month"
  186. ExpiresByType image/gif "access plus 1 month"
  187. ExpiresByType image/jpeg "access plus 1 month"
  188. ExpiresByType image/png "access plus 1 month"
  189. ExpiresByType video/mp4 "access plus 1 month"
  190. ExpiresByType video/ogg "access plus 1 month"
  191. ExpiresByType video/webm "access plus 1 month"
  192.  
  193. # Web feeds
  194. ExpiresByType application/atom+xml "access plus 1 hour"
  195. ExpiresByType application/rss+xml "access plus 1 hour"
  196.  
  197. # Web fonts
  198. ExpiresByType application/font-woff "access plus 1 month"
  199. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  200. ExpiresByType application/x-font-ttf "access plus 1 month"
  201. ExpiresByType font/opentype "access plus 1 month"
  202. ExpiresByType image/svg+xml "access plus 1 month"
  203.  
  204. </IfModule>
  205.  
  206. RewriteCond %{REQUEST_URI} !/adm/?
  207.  
  208. <IfModule mod_rewrite.c>
  209. RewriteCond %{HTTPS} !=on
  210. RewriteCond %{HTTP_HOST} !^www..+$ [NC]
  211. RewriteCond %{HTTP_HOST} !=localhost [NC]
  212. RewriteCond %{HTTP_HOST} !=127.0.0.1
  213. RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  214. </IfModule>
  215.  
  216. <IfModule mod_rewrite.c>
  217. RewriteCond %{HTTPS} !=on
  218. RewriteCond %{HTTP_HOST} !^www..+$ [NC]
  219. RewriteCond %{HTTP_HOST} !=localhost [NC]
  220. RewriteCond %{HTTP_HOST} !=127.0.0.1
  221. RewriteCond %{REQUEST_URI} !/adm/?
  222. RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  223. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement