.htaccess 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. Options +FollowSymLinks
  2. # BEGIN WordPress
  3. <IfModule mod_rewrite.c>
  4. RewriteEngine On
  5. RewriteBase /wp/
  6. RewriteRule ^index\.php$ - [L]
  7. RewriteCond %{REQUEST_FILENAME} !-f
  8. RewriteCond %{REQUEST_FILENAME} !-d
  9. RewriteRule . /wp/index.php [L]
  10. </IfModule>
  11. # END WordPress
  12. #### Use /wp/ subdirectory ####
  13. <IfModule mod_rewrite.c>
  14. RewriteEngine On
  15. RewriteBase /
  16. RewriteRule ^(wp-admin/.*)$ /wp/$1 [L]
  17. RewriteRule ^(wp-[^/]+\.php)$ /wp/$1 [L]
  18. RewriteRule ^xmlrpc\.php$ /wp/xmlrpc.php [L]
  19. RewriteRule ^(wp-includes/.*)$ /wp/$1 [L]
  20. </IfModule>
  21. #### Force SSL ####
  22. #RewriteEngine On
  23. #RewriteCond %{HTTPS} !=on
  24. #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  25. #</IfModule>
  26. <IfModule mod_headers.c>
  27. <FilesMatch "\.(eot|otf|tt[cf]|woff)$">
  28. Header set Access-Control-Allow-Origin "*"
  29. </FilesMatch>
  30. </IfModule>
  31. <IfModule mod_headers.c>
  32. Header set X-UA-Compatible "IE=edge"
  33. <FilesMatch "\.(appcache|atom|crx|css|cur|eot|f4[abpv]|flv|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|tt[cf]|vcf|vtt|webapp|web[mp]|woff|xml|xpi)$">
  34. Header unset X-UA-Compatible
  35. </FilesMatch>
  36. </IfModule>
  37. Header set Cache-Control "max-age=7200, must-revalidate"
  38. <IfModule mod_mime.c>
  39. AddType audio/mp4 m4a f4a f4b
  40. AddType audio/ogg oga ogg opus
  41. AddType application/json json map
  42. AddType application/ld+json jsonld
  43. AddType application/javascript js
  44. AddType video/mp4 f4v f4p m4v mp4
  45. AddType video/ogg ogv
  46. AddType video/webm webm
  47. AddType video/x-flv flv
  48. AddType application/font-woff woff
  49. AddType application/vnd.ms-fontobject eot
  50. AddType application/x-font-ttf ttc ttf
  51. AddType font/opentype otf
  52. AddType image/svg+xml svgz
  53. AddEncoding gzip svgz
  54. AddType application/octet-stream safariextz
  55. AddType application/x-chrome-extension crx
  56. AddType application/x-web-app-manifest+json webapp
  57. AddType application/xml atom rdf rss xml
  58. AddType image/x-icon cur
  59. AddType text/cache-manifest appcache manifest
  60. AddType text/x-vcard vcf
  61. </IfModule>
  62. <IfModule mod_mime.c>
  63. AddCharset utf-8 .atom .css .js .json .jsonld .rss .vtt .webapp .xml
  64. </IfModule>
  65. <IfModule mod_expires.c>
  66. ExpiresActive on
  67. ExpiresDefault "access plus 1 month"
  68. ExpiresByType text/html "access plus 0 seconds"
  69. ExpiresByType text/css "access plus 1 year"
  70. ExpiresByType image/jpeg "access plus 1 year"
  71. ExpiresByType image/png "access plus 1 year"
  72. ExpiresByType application/javascript "access plus 1 year"
  73. ExpiresByType text/javascript "access plus 1 year"
  74. ExpiresByType text/javascript A2592000
  75. ExpiresByType image/x-icon "access plus 1 week"
  76. ExpiresByType text/x-component "access plus 1 month"
  77. ExpiresByType audio/ogg "access plus 1 month"
  78. ExpiresByType image/gif "access plus 1 month"
  79. ExpiresByType video/mp4 "access plus 1 month"
  80. ExpiresByType video/ogg "access plus 1 month"
  81. ExpiresByType video/webm "access plus 1 month"
  82. ExpiresByType application/font-woff "access plus 1 month"
  83. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  84. ExpiresByType application/x-font-ttf "access plus 1 month"
  85. ExpiresByType font/opentype "access plus 1 month"
  86. ExpiresByType image/svg+xml "access plus 1 month"
  87. ExpiresByType text/xml "access plus 0 seconds"
  88. ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
  89. ExpiresByType text/cache-manifest "access plus 0 seconds"
  90. ExpiresByType application/json "access plus 0 seconds"
  91. ExpiresByType application/ld+json "access plus 0 seconds"
  92. ExpiresByType application/xml "access plus 0 seconds"
  93. ExpiresByType application/atom+xml "access plus 1 hour"
  94. ExpiresByType application/rss+xml "access plus 1 hour"
  95. </IfModule>
  96. <IfModule mod_deflate.c>
  97. <IfModule mod_setenvif.c>
  98. <IfModule mod_headers.c>
  99. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  100. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  101. </IfModule>
  102. </IfModule>
  103. <IfModule mod_filter.c>
  104. AddOutputFilterByType DEFLATE application/atom+xml \
  105. application/javascript \
  106. application/json \
  107. application/ld+json \
  108. application/rss+xml \
  109. application/vnd.ms-fontobject \
  110. application/x-font-ttf \
  111. application/x-web-app-manifest+json \
  112. application/xhtml+xml \
  113. application/xml \
  114. font/opentype \
  115. image/svg+xml \
  116. image/x-icon \
  117. text/css \
  118. text/html \
  119. text/plain \
  120. text/x-component \
  121. text/xml
  122. </IfModule>
  123. </IfModule>
  124. <IfModule mod_headers.c>
  125. Header unset ETag
  126. </IfModule>
  127. FileETag None
  128. <IfModule mod_setenvif.c>
  129. <IfModule mod_headers.c>
  130. <FilesMatch "\.(cur|gif|ico|jpe?g|png|svgz?|webp)$">
  131. SetEnvIf Origin ":" IS_CORS
  132. Header set Access-Control-Allow-Origin "*" env=IS_CORS
  133. </FilesMatch>
  134. </IfModule>
  135. </IfModule>
  136. <IfModule mod_headers.c>
  137. Header set X-Frame-Options "DENY"
  138. <FilesMatch "\.(appcache|atom|crx|css|cur|eot|f4[abpv]|flv|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|tt[cf]|vcf|vtt|webapp|web[mp]|woff|xml|xpi)$">
  139. Header unset X-Frame-Options
  140. </FilesMatch>
  141. </IfModule>
  142. <IfModule mod_autoindex.c>
  143. Options -Indexes
  144. </IfModule>
  145. <IfModule mod_rewrite.c>
  146. RewriteCond %{SCRIPT_FILENAME} -d [OR]
  147. RewriteCond %{SCRIPT_FILENAME} -f
  148. RewriteRule "(^|/)\." - [F]
  149. </IfModule>
  150. <FilesMatch "(^#.*#|\.(bak|config|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$">
  151. <IfModule !mod_authz_core.c>
  152. Order allow,deny
  153. Deny from all
  154. Satisfy All
  155. </IfModule>
  156. <IfModule mod_authz_core.c>
  157. Require all denied
  158. </IfModule>
  159. </FilesMatch>
  160. <IfModule mod_headers.c>
  161. Header set X-Content-Type-Options "nosniff"
  162. </IfModule>
  163. <IfModule mod_headers.c>
  164. Header set X-XSS-Protection "1; mode=block"
  165. <FilesMatch "\.(appcache|atom|crx|css|cur|eot|f4[abpv]|flv|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|tt[cf]|vcf|vtt|webapp|web[mp]|woff|xml|xpi)$">
  166. Header unset X-XSS-Protection
  167. </FilesMatch>
  168. </IfModule>