.htaccess 7.8 KB

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