.htaccess 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225
  1. # Apache Server Configs v4.0.0 | MIT License
  2. # https://github.com/h5bp/server-configs-apache
  3. # (!) Using `.htaccess` files slows down Apache, therefore, if you have
  4. # access to the main server configuration file (which is usually called
  5. # `httpd.conf`), you should add this logic there.
  6. #
  7. # https://httpd.apache.org/docs/current/howto/htaccess.html
  8. # ######################################################################
  9. # # CROSS-ORIGIN #
  10. # ######################################################################
  11. # ----------------------------------------------------------------------
  12. # | Cross-origin requests |
  13. # ----------------------------------------------------------------------
  14. # Allow cross-origin requests.
  15. #
  16. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
  17. # https://enable-cors.org/
  18. # https://www.w3.org/TR/cors/
  19. # (!) Do not use this without understanding the consequences.
  20. # This will permit access from any other website.
  21. # Instead of using this file, consider using a specific rule such as
  22. # allowing access based on (sub)domain:
  23. #
  24. # Header set Access-Control-Allow-Origin "subdomain.example.com"
  25. # <IfModule mod_headers.c>
  26. # Header set Access-Control-Allow-Origin "*"
  27. # </IfModule>
  28. # ----------------------------------------------------------------------
  29. # | Cross-origin images |
  30. # ----------------------------------------------------------------------
  31. # Send the CORS header for images when browsers request it.
  32. #
  33. # https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image
  34. # https://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
  35. <IfModule mod_setenvif.c>
  36. <IfModule mod_headers.c>
  37. <FilesMatch "\.(bmp|cur|gif|ico|jpe?g|a?png|svgz?|webp)$">
  38. SetEnvIf Origin ":" IS_CORS
  39. Header set Access-Control-Allow-Origin "*" env=IS_CORS
  40. </FilesMatch>
  41. </IfModule>
  42. </IfModule>
  43. # ----------------------------------------------------------------------
  44. # | Cross-origin web fonts |
  45. # ----------------------------------------------------------------------
  46. # Allow cross-origin access to web fonts.
  47. #
  48. # https://developers.google.com/fonts/docs/troubleshooting
  49. <IfModule mod_headers.c>
  50. <FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
  51. Header set Access-Control-Allow-Origin "*"
  52. </FilesMatch>
  53. </IfModule>
  54. # ----------------------------------------------------------------------
  55. # | Cross-origin resource timing |
  56. # ----------------------------------------------------------------------
  57. # Allow cross-origin access to the timing information for all resources.
  58. #
  59. # If a resource isn't served with a `Timing-Allow-Origin` header that would
  60. # allow its timing information to be shared with the document, some of the
  61. # attributes of the `PerformanceResourceTiming` object will be set to zero.
  62. #
  63. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin
  64. # https://www.w3.org/TR/resource-timing/
  65. # https://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/
  66. # <IfModule mod_headers.c>
  67. # Header set Timing-Allow-Origin: "*"
  68. # </IfModule>
  69. # ######################################################################
  70. # # ERRORS #
  71. # ######################################################################
  72. # ----------------------------------------------------------------------
  73. # | Custom error messages/pages |
  74. # ----------------------------------------------------------------------
  75. # Customize what Apache returns to the client in case of an error.
  76. #
  77. # https://httpd.apache.org/docs/current/mod/core.html#errordocument
  78. ErrorDocument 404 /404.html
  79. # ----------------------------------------------------------------------
  80. # | Error prevention |
  81. # ----------------------------------------------------------------------
  82. # Disable the pattern matching based on filenames.
  83. #
  84. # This setting prevents Apache from returning a 404 error as the result of a
  85. # rewrite when the directory with the same name does not exist.
  86. #
  87. # https://httpd.apache.org/docs/current/content-negotiation.html#multiviews
  88. Options -MultiViews
  89. # ######################################################################
  90. # # INTERNET EXPLORER #
  91. # ######################################################################
  92. # ----------------------------------------------------------------------
  93. # | Document modes |
  94. # ----------------------------------------------------------------------
  95. # Force Internet Explorer 8/9/10 to render pages in the highest mode
  96. # available in various cases when it may not.
  97. #
  98. # https://hsivonen.fi/doctype/#ie8
  99. #
  100. # (!) Starting with Internet Explorer 11, document modes are deprecated.
  101. # If your business still relies on older web apps and services that were
  102. # designed for older versions of Internet Explorer, you might want to
  103. # consider enabling `Enterprise Mode` throughout your company.
  104. #
  105. # https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
  106. # https://blogs.msdn.microsoft.com/ie/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11/
  107. # https://msdn.microsoft.com/en-us/library/ff955275.aspx
  108. <IfModule mod_headers.c>
  109. Header always set X-UA-Compatible "IE=edge" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
  110. </IfModule>
  111. # ######################################################################
  112. # # MEDIA TYPES AND CHARACTER ENCODINGS #
  113. # ######################################################################
  114. # ----------------------------------------------------------------------
  115. # | Media types |
  116. # ----------------------------------------------------------------------
  117. # Serve resources with the proper media types (f.k.a. MIME types).
  118. #
  119. # https://www.iana.org/assignments/media-types/media-types.xhtml
  120. # https://httpd.apache.org/docs/current/mod/mod_mime.html#addtype
  121. <IfModule mod_mime.c>
  122. # Data interchange
  123. AddType application/atom+xml atom
  124. AddType application/json json map topojson
  125. AddType application/ld+json jsonld
  126. AddType application/rss+xml rss
  127. AddType application/geo+json geojson
  128. AddType application/rdf+xml rdf
  129. AddType application/xml xml
  130. # JavaScript
  131. # Servers should use text/javascript for JavaScript resources.
  132. # https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages
  133. AddType text/javascript js mjs
  134. # Manifest files
  135. AddType application/manifest+json webmanifest
  136. AddType application/x-web-app-manifest+json webapp
  137. AddType text/cache-manifest appcache
  138. # Media files
  139. AddType audio/mp4 f4a f4b m4a
  140. AddType audio/ogg oga ogg opus
  141. AddType image/bmp bmp
  142. AddType image/svg+xml svg svgz
  143. AddType image/webp webp
  144. AddType video/mp4 f4v f4p m4v mp4
  145. AddType video/ogg ogv
  146. AddType video/webm webm
  147. AddType video/x-flv flv
  148. # Serving `.ico` image files with a different media type prevents
  149. # Internet Explorer from displaying them as images:
  150. # https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
  151. AddType image/x-icon cur ico
  152. # WebAssembly
  153. AddType application/wasm wasm
  154. # Web fonts
  155. AddType font/woff woff
  156. AddType font/woff2 woff2
  157. AddType application/vnd.ms-fontobject eot
  158. AddType font/ttf ttf
  159. AddType font/collection ttc
  160. AddType font/otf otf
  161. # Other
  162. AddType application/octet-stream safariextz
  163. AddType application/x-bb-appworld bbaw
  164. AddType application/x-chrome-extension crx
  165. AddType application/x-opera-extension oex
  166. AddType application/x-xpinstall xpi
  167. AddType text/calendar ics
  168. AddType text/markdown markdown md
  169. AddType text/vcard vcard vcf
  170. AddType text/vnd.rim.location.xloc xloc
  171. AddType text/vtt vtt
  172. AddType text/x-component htc
  173. </IfModule>
  174. # ----------------------------------------------------------------------
  175. # | Character encodings |
  176. # ----------------------------------------------------------------------
  177. # Serve all resources labeled as `text/html` or `text/plain` with the media type
  178. # `charset` parameter set to `UTF-8`.
  179. #
  180. # https://httpd.apache.org/docs/current/mod/core.html#adddefaultcharset
  181. AddDefaultCharset utf-8
  182. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  183. # Serve the following file types with the media type `charset` parameter set to
  184. # `UTF-8`.
  185. #
  186. # https://httpd.apache.org/docs/current/mod/mod_mime.html#addcharset
  187. <IfModule mod_mime.c>
  188. AddCharset utf-8 .appcache \
  189. .bbaw \
  190. .css \
  191. .htc \
  192. .ics \
  193. .js \
  194. .json \
  195. .manifest \
  196. .map \
  197. .markdown \
  198. .md \
  199. .mjs \
  200. .topojson \
  201. .vtt \
  202. .vcard \
  203. .vcf \
  204. .webmanifest \
  205. .xloc
  206. </IfModule>
  207. # ######################################################################
  208. # # REWRITES #
  209. # ######################################################################
  210. # ----------------------------------------------------------------------
  211. # | Rewrite engine |
  212. # ----------------------------------------------------------------------
  213. # (1) Turn on the rewrite engine (this is necessary in order for the
  214. # `RewriteRule` directives to work).
  215. #
  216. # https://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteEngine
  217. #
  218. # (2) Enable the `FollowSymLinks` option if it isn't already.
  219. #
  220. # https://httpd.apache.org/docs/current/mod/core.html#options
  221. #
  222. # (3) If your web host doesn't allow the `FollowSymlinks` option, you need to
  223. # comment it out or remove it, and then uncomment the
  224. # `Options +SymLinksIfOwnerMatch` line (4), but be aware of the performance
  225. # impact.
  226. #
  227. # https://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
  228. #
  229. # (4) Some cloud hosting services will require you set `RewriteBase`.
  230. #
  231. # https://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-modrewrite-not-working-on-my-site
  232. # https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
  233. #
  234. # (5) Depending on how your server is set up, you may also need to use the
  235. # `RewriteOptions` directive to enable some options for the rewrite engine.
  236. #
  237. # https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteoptions
  238. <IfModule mod_rewrite.c>
  239. # (1)
  240. RewriteEngine On
  241. # (2)
  242. Options +FollowSymlinks
  243. # (3)
  244. # Options +SymLinksIfOwnerMatch
  245. # (4)
  246. # RewriteBase /
  247. # (5)
  248. # RewriteOptions <options>
  249. </IfModule>
  250. # ----------------------------------------------------------------------
  251. # | Forcing `https://` |
  252. # ----------------------------------------------------------------------
  253. # Redirect from the `http://` to the `https://` version of the URL.
  254. #
  255. # https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
  256. # (1) If you're using cPanel AutoSSL or the Let's Encrypt webroot method it
  257. # will fail to validate the certificate if validation requests are
  258. # redirected to HTTPS. Turn on the condition(s) you need.
  259. #
  260. # https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml
  261. # https://tools.ietf.org/html/draft-ietf-acme-acme-12
  262. # <IfModule mod_rewrite.c>
  263. # RewriteEngine On
  264. # RewriteCond %{HTTPS} !=on
  265. # # (1)
  266. # # RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
  267. # # RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[\w-]+$
  268. # # RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
  269. # RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  270. # </IfModule>
  271. # ----------------------------------------------------------------------
  272. # | Suppressing the `www.` at the beginning of URLs |
  273. # ----------------------------------------------------------------------
  274. # Rewrite www.example.com → example.com
  275. # The same content should never be available under two different URLs,
  276. # especially not with and without `www.` at the beginning.
  277. # This can cause SEO problems (duplicate content), and therefore, you should
  278. # choose one of the alternatives and redirect the other one.
  279. #
  280. # (!) NEVER USE BOTH WWW-RELATED RULES AT THE SAME TIME!
  281. # (1) Set %{ENV:PROTO} variable, to allow rewrites to redirect with the
  282. # appropriate schema automatically (http or https).
  283. #
  284. # (2) The rule assumes by default that both HTTP and HTTPS environments are
  285. # available for redirection.
  286. # If your SSL certificate could not handle one of the domains used during
  287. # redirection, you should turn the condition on.
  288. #
  289. # https://github.com/h5bp/server-configs-apache/issues/52
  290. <IfModule mod_rewrite.c>
  291. RewriteEngine On
  292. # (1)
  293. RewriteCond %{HTTPS} =on
  294. RewriteRule ^ - [E=PROTO:https]
  295. RewriteCond %{HTTPS} !=on
  296. RewriteRule ^ - [E=PROTO:http]
  297. # (2)
  298. # RewriteCond %{HTTPS} !=on
  299. RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  300. RewriteRule ^ %{ENV:PROTO}://%1%{REQUEST_URI} [R=301,L]
  301. </IfModule>
  302. # ----------------------------------------------------------------------
  303. # | Forcing the `www.` at the beginning of URLs |
  304. # ----------------------------------------------------------------------
  305. # Rewrite example.com → www.example.com
  306. # The same content should never be available under two different URLs,
  307. # especially not with and without `www.` at the beginning.
  308. # This can cause SEO problems (duplicate content), and therefore, you should
  309. # choose one of the alternatives and redirect the other one.
  310. #
  311. # (!) NEVER USE BOTH WWW-RELATED RULES AT THE SAME TIME!
  312. # (1) Set %{ENV:PROTO} variable, to allow rewrites to redirect with the
  313. # appropriate schema automatically (http or https).
  314. #
  315. # (2) The rule assumes by default that both HTTP and HTTPS environments are
  316. # available for redirection.
  317. # If your SSL certificate could not handle one of the domains used during
  318. # redirection, you should turn the condition on.
  319. #
  320. # https://github.com/h5bp/server-configs-apache/issues/52
  321. # Be aware that the following might not be a good idea if you use "real"
  322. # subdomains for certain parts of your website.
  323. # <IfModule mod_rewrite.c>
  324. # RewriteEngine On
  325. # # (1)
  326. # RewriteCond %{HTTPS} =on
  327. # RewriteRule ^ - [E=PROTO:https]
  328. # RewriteCond %{HTTPS} !=on
  329. # RewriteRule ^ - [E=PROTO:http]
  330. # # (2)
  331. # # RewriteCond %{HTTPS} !=on
  332. # RewriteCond %{HTTP_HOST} !^www\. [NC]
  333. # RewriteCond %{SERVER_ADDR} !=127.0.0.1
  334. # RewriteCond %{SERVER_ADDR} !=::1
  335. # RewriteRule ^ %{ENV:PROTO}://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  336. # </IfModule>
  337. # ######################################################################
  338. # # SECURITY #
  339. # ######################################################################
  340. # ----------------------------------------------------------------------
  341. # | Frame Options |
  342. # ----------------------------------------------------------------------
  343. # Protect website against clickjacking.
  344. #
  345. # The example below sends the `X-Frame-Options` response header with the value
  346. # `DENY`, informing browsers not to display the content of the web page in any
  347. # frame.
  348. #
  349. # This might not be the best setting for everyone. You should read about the
  350. # other two possible values the `X-Frame-Options` header field can have:
  351. # `SAMEORIGIN` and `ALLOW-FROM`.
  352. # https://tools.ietf.org/html/rfc7034#section-2.1.
  353. #
  354. # Keep in mind that while you could send the `X-Frame-Options` header for all
  355. # of your website's pages, this has the potential downside that it forbids even
  356. # non-malicious framing of your content (e.g.: when users visit your website
  357. # using a Google Image Search results page).
  358. #
  359. # Nonetheless, you should ensure that you send the `X-Frame-Options` header for
  360. # all pages that allow a user to make a state-changing operation (e.g: pages
  361. # that contain one-click purchase links, checkout or bank-transfer confirmation
  362. # pages, pages that make permanent configuration changes, etc.).
  363. #
  364. # Sending the `X-Frame-Options` header can also protect your website against
  365. # more than just clickjacking attacks.
  366. # https://cure53.de/xfo-clickjacking.pdf.
  367. #
  368. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
  369. # https://tools.ietf.org/html/rfc7034
  370. # https://blogs.msdn.microsoft.com/ieinternals/2010/03/30/combating-clickjacking-with-x-frame-options/
  371. # https://www.owasp.org/index.php/Clickjacking
  372. # <IfModule mod_headers.c>
  373. # Header always set X-Frame-Options "DENY" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
  374. # </IfModule>
  375. # ----------------------------------------------------------------------
  376. # | Content Security Policy (CSP) |
  377. # ----------------------------------------------------------------------
  378. # Mitigate the risk of cross-site scripting and other content-injection
  379. # attacks.
  380. #
  381. # This can be done by setting a `Content Security Policy` which whitelists
  382. # trusted sources of content for your website.
  383. #
  384. # There is no policy that fits all websites, you will have to modify the
  385. # `Content-Security-Policy` directives in the example depending on your needs.
  386. #
  387. # The example policy below aims to:
  388. #
  389. # (1) Restrict all fetches by default to the origin of the current website by
  390. # setting the `default-src` directive to `'self'` - which acts as a
  391. # fallback to all "Fetch directives" (https://developer.mozilla.org/en-US/docs/Glossary/Fetch_directive).
  392. #
  393. # This is convenient as you do not have to specify all Fetch directives
  394. # that apply to your site, for example:
  395. # `connect-src 'self'; font-src 'self'; script-src 'self'; style-src 'self'`, etc.
  396. #
  397. # This restriction also means that you must explicitly define from which
  398. # site(s) your website is allowed to load resources from.
  399. #
  400. # (2) The `<base>` element is not allowed on the website. This is to prevent
  401. # attackers from changing the locations of resources loaded from relative
  402. # URLs.
  403. #
  404. # If you want to use the `<base>` element, then `base-uri 'self'` can be
  405. # used instead.
  406. #
  407. # (3) Form submissions are only allowed from the current website by setting:
  408. # `form-action 'self'`.
  409. #
  410. # (4) Prevents all websites (including your own) from embedding your webpages
  411. # within e.g. the `<iframe>` or `<object>` element by setting:
  412. # `frame-ancestors 'none'`.
  413. #
  414. # The `frame-ancestors` directive helps avoid "Clickjacking" attacks and
  415. # is similar to the `X-Frame-Options` header.
  416. #
  417. # Browsers that support the CSP header will ignore `X-Frame-Options` if
  418. # `frame-ancestors` is also specified.
  419. #
  420. # (5) Forces the browser to treat all the resources that are served over HTTP
  421. # as if they were loaded securely over HTTPS by setting the
  422. # `upgrade-insecure-requests` directive.
  423. #
  424. # Please note that `upgrade-insecure-requests` does not ensure HTTPS for
  425. # the top-level navigation. If you want to force the website itself to be
  426. # loaded over HTTPS you must include the `Strict-Transport-Security`
  427. # header.
  428. #
  429. # (6) The `Content-Security-Policy` header is included in all responses
  430. # that are able to execute scripting. This includes the commonly used
  431. # file types: HTML, XML and PDF documents. Although Javascript files
  432. # can not execute script in a "browsing context", they are still included
  433. # to target workers:
  434. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#CSP_in_workers
  435. #
  436. # To make your CSP implementation easier, you can use an online CSP header
  437. # generator such as:
  438. # https://report-uri.com/home/generate/
  439. #
  440. # It is encouraged that you validate your CSP header using a CSP validator
  441. # such as:
  442. # https://csp-evaluator.withgoogle.com
  443. #
  444. # https://csp.withgoogle.com/docs/
  445. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
  446. # https://www.html5rocks.com/en/tutorials/security/content-security-policy/
  447. # https://www.w3.org/TR/CSP/
  448. # <IfModule mod_headers.c>
  449. # # (1) (2) (3) (4) (5) (6)
  450. # Header always set Content-Security-Policy "default-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
  451. # </IfModule>
  452. # ----------------------------------------------------------------------
  453. # | File access |
  454. # ----------------------------------------------------------------------
  455. # Block access to directories without a default document.
  456. #
  457. # You should leave the following uncommented, as you shouldn't allow anyone to
  458. # surf through every directory on your server (which may include rather
  459. # private places such as the CMS's directories).
  460. <IfModule mod_autoindex.c>
  461. Options -Indexes
  462. </IfModule>
  463. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  464. # Block access to all hidden files and directories except for the
  465. # visible content from within the `/.well-known/` hidden directory.
  466. #
  467. # These types of files usually contain user preferences or the preserved state
  468. # of a utility, and can include rather private places like, for example, the
  469. # `.git` or `.svn` directories.
  470. #
  471. # The `/.well-known/` directory represents the standard (RFC 5785) path prefix
  472. # for "well-known locations" (e.g.: `/.well-known/manifest.json`,
  473. # `/.well-known/keybase.txt`), and therefore, access to its visible content
  474. # should not be blocked.
  475. #
  476. # https://www.mnot.net/blog/2010/04/07/well-known
  477. # https://tools.ietf.org/html/rfc5785
  478. <IfModule mod_rewrite.c>
  479. RewriteEngine On
  480. RewriteCond %{REQUEST_URI} "!(^|/)\.well-known/([^./]+./?)+$" [NC]
  481. RewriteCond %{SCRIPT_FILENAME} -d [OR]
  482. RewriteCond %{SCRIPT_FILENAME} -f
  483. RewriteRule "(^|/)\." - [F]
  484. </IfModule>
  485. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  486. # Block access to files that can expose sensitive information.
  487. #
  488. # By default, block access to backup and source files that may be left by some
  489. # text editors and can pose a security risk when anyone has access to them.
  490. #
  491. # https://feross.org/cmsploit/
  492. #
  493. # (!) Update the `<FilesMatch>` regular expression from below to include any
  494. # files that might end up on your production server and can expose
  495. # sensitive information about your website. These files may include:
  496. # configuration files, files that contain metadata about the project (e.g.:
  497. # project dependencies, build scripts, etc.).
  498. <IfModule mod_authz_core.c>
  499. <FilesMatch "(^#.*#|\.(bak|conf|dist|fla|in[ci]|log|orig|psd|sh|sql|sw[op])|~)$">
  500. Require all denied
  501. </FilesMatch>
  502. </IfModule>
  503. # ----------------------------------------------------------------------
  504. # | HTTP Strict Transport Security (HSTS) |
  505. # ----------------------------------------------------------------------
  506. # Force client-side TLS (Transport Layer Security) redirection.
  507. #
  508. # If a user types `example.com` in their browser, even if the server redirects
  509. # them to the secure version of the website, that still leaves a window of
  510. # opportunity (the initial HTTP connection) for an attacker to downgrade or
  511. # redirect the request.
  512. #
  513. # The following header ensures that a browser only connects to your server
  514. # via HTTPS, regardless of what the users type in the browser's address bar.
  515. #
  516. # (!) Be aware that Strict Transport Security is not revokable and you
  517. # must ensure being able to serve the site over HTTPS for the duration
  518. # you've specified in the `max-age` directive. When you don't have a
  519. # valid TLS connection anymore (e.g. due to an expired TLS certificate)
  520. # your visitors will see a nasty error message even when attempting to
  521. # connect over HTTP.
  522. #
  523. # (1) Preloading Strict Transport Security.
  524. # To submit your site for HSTS preloading, it is required that:
  525. # * the `includeSubDomains` directive is specified
  526. # * the `preload` directive is specified
  527. # * the `max-age` is specified with a value of at least 31536000 seconds
  528. # (1 year).
  529. # https://hstspreload.org/#deployment-recommendations
  530. #
  531. # https://tools.ietf.org/html/rfc6797#section-6.1
  532. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
  533. # https://www.html5rocks.com/en/tutorials/security/transport-layer-security/
  534. # https://blogs.msdn.microsoft.com/ieinternals/2014/08/18/strict-transport-security/
  535. # https://hstspreload.org/
  536. # <IfModule mod_headers.c>
  537. # Header always set Strict-Transport-Security "max-age=16070400; includeSubDomains" "expr=%{HTTPS} == 'on'"
  538. # # (1) Enable your site for HSTS preload inclusion.
  539. # # Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" "expr=%{HTTPS} == 'on'"
  540. # </IfModule>
  541. # ----------------------------------------------------------------------
  542. # | Content Type Options |
  543. # ----------------------------------------------------------------------
  544. # Prevent some browsers from MIME-sniffing the response.
  545. #
  546. # This reduces exposure to drive-by download attacks and cross-origin data
  547. # leaks, and should be left uncommented, especially if the server is serving
  548. # user-uploaded content or content that could potentially be treated as
  549. # executable by the browser.
  550. #
  551. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
  552. # https://blogs.msdn.microsoft.com/ie/2008/07/02/ie8-security-part-v-comprehensive-protection/
  553. # https://mimesniff.spec.whatwg.org/
  554. <IfModule mod_headers.c>
  555. Header always set X-Content-Type-Options "nosniff"
  556. </IfModule>
  557. # ----------------------------------------------------------------------
  558. # | Cross-Site Scripting (XSS) Protection |
  559. # ----------------------------------------------------------------------
  560. # Protect website reflected Cross-Site Scripting (XSS) attacks.
  561. #
  562. # (1) Try to re-enable the cross-site scripting (XSS) filter built into most
  563. # web browsers.
  564. #
  565. # The filter is usually enabled by default, but in some cases, it may be
  566. # disabled by the user. However, in Internet Explorer, for example, it can be
  567. # re-enabled just by sending the `X-XSS-Protection` header with the value
  568. # of `1`.
  569. #
  570. # (2) Prevent web browsers from rendering the web page if a potential reflected
  571. # (a.k.a non-persistent) XSS attack is detected by the filter.
  572. #
  573. # By default, if the filter is enabled and browsers detect a reflected XSS
  574. # attack, they will attempt to block the attack by making the smallest
  575. # possible modifications to the returned web page.
  576. #
  577. # Unfortunately, in some browsers (e.g.: Internet Explorer), this default
  578. # behavior may allow the XSS filter to be exploited. Therefore, it's better
  579. # to inform browsers to prevent the rendering of the page altogether,
  580. # instead of attempting to modify it.
  581. #
  582. # https://hackademix.net/2009/11/21/ies-xss-filter-creates-xss-vulnerabilities
  583. #
  584. # (!) Do not rely on the XSS filter to prevent XSS attacks! Ensure that you are
  585. # taking all possible measures to prevent XSS attacks, the most obvious
  586. # being: validating and sanitizing your website's inputs.
  587. #
  588. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
  589. # https://blogs.msdn.microsoft.com/ie/2008/07/02/ie8-security-part-iv-the-xss-filter/
  590. # https://blogs.msdn.microsoft.com/ieinternals/2011/01/31/controlling-the-xss-filter/
  591. # https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29
  592. # <IfModule mod_headers.c>
  593. # # (1) (2)
  594. # Header always set X-XSS-Protection "1; mode=block" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
  595. # </IfModule>
  596. # ----------------------------------------------------------------------
  597. # | Referrer Policy |
  598. # ----------------------------------------------------------------------
  599. # Set a strict Referrer Policy to mitigate information leakage.
  600. #
  601. # (1) The `Referrer-Policy` header is included in responses for resources
  602. # that are able to request (or navigate to) other resources.
  603. #
  604. # This includes the commonly used resource types:
  605. # HTML, CSS, XML/SVG, PDF documents, scripts and workers.
  606. #
  607. # To prevent referrer leakage entirely, specify the `no-referrer` value
  608. # instead. Note that the effect could impact analytics metrics negatively.
  609. #
  610. # To check your Referrer Policy, you can use an online service, such as:
  611. # https://securityheaders.com/
  612. # https://observatory.mozilla.org/
  613. #
  614. # https://scotthelme.co.uk/a-new-security-header-referrer-policy/
  615. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
  616. # <IfModule mod_headers.c>
  617. # # (1)
  618. # Header always set Referrer-Policy "strict-origin-when-cross-origin" "expr=%{CONTENT_TYPE} =~ m#text\/(css|html|javascript)|application\/pdf|xml#i"
  619. # </IfModule>
  620. # ----------------------------------------------------------------------
  621. # | Disable TRACE HTTP Method |
  622. # ----------------------------------------------------------------------
  623. # Prevent Apache from responding to `TRACE` HTTP request.
  624. #
  625. # The TRACE method, while seemingly harmless, can be successfully leveraged
  626. # in some scenarios to steal legitimate users' credentials.
  627. #
  628. # Modern browsers now prevent TRACE requests being made via JavaScript,
  629. # however, other ways of sending TRACE requests with browsers have been
  630. # discovered, such as using Java.
  631. #
  632. # (!) If you have access to the main server configuration file, use the
  633. # `TraceEnable` directive instead.
  634. #
  635. # https://tools.ietf.org/html/rfc7231#section-4.3.8
  636. # https://www.owasp.org/index.php/Cross_Site_Tracing
  637. # https://www.owasp.org/index.php/Test_HTTP_Methods_(OTG-CONFIG-006)
  638. # https://httpd.apache.org/docs/current/mod/core.html#traceenable
  639. # <IfModule mod_rewrite.c>
  640. # RewriteEngine On
  641. # RewriteCond %{REQUEST_METHOD} ^TRACE [NC]
  642. # RewriteRule .* - [R=405,L]
  643. # </IfModule>
  644. # ----------------------------------------------------------------------
  645. # | Server-side technology information |
  646. # ----------------------------------------------------------------------
  647. # Remove the `X-Powered-By` response header that:
  648. #
  649. # * is set by some frameworks and server-side languages (e.g.: ASP.NET, PHP),
  650. # and its value contains information about them (e.g.: their name, version
  651. # number)
  652. #
  653. # * doesn't provide any value to users, contributes to header bloat, and in
  654. # some cases, the information it provides can expose vulnerabilities
  655. #
  656. # (!) If you can, you should disable the `X-Powered-By` header from the
  657. # language/framework level (e.g.: for PHP, you can do that by setting
  658. # `expose_php = off` in `php.ini`).
  659. #
  660. # https://php.net/manual/en/ini.core.php#ini.expose-php
  661. <IfModule mod_headers.c>
  662. Header unset X-Powered-By
  663. Header always unset X-Powered-By
  664. </IfModule>
  665. # ----------------------------------------------------------------------
  666. # | Server software information |
  667. # ----------------------------------------------------------------------
  668. # Prevent Apache from adding a trailing footer line containing information
  669. # about the server to the server-generated documents (e.g.: error messages,
  670. # directory listings, etc.).
  671. #
  672. # https://httpd.apache.org/docs/current/mod/core.html#serversignature
  673. ServerSignature Off
  674. # ######################################################################
  675. # # WEB PERFORMANCE #
  676. # ######################################################################
  677. # ----------------------------------------------------------------------
  678. # | Compression |
  679. # ----------------------------------------------------------------------
  680. <IfModule mod_deflate.c>
  681. # Force compression for mangled `Accept-Encoding` request headers
  682. #
  683. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
  684. # https://calendar.perfplanet.com/2010/pushing-beyond-gzipping/
  685. <IfModule mod_setenvif.c>
  686. <IfModule mod_headers.c>
  687. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  688. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  689. </IfModule>
  690. </IfModule>
  691. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  692. # Compress all output labeled with one of the following media types.
  693. #
  694. # https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
  695. <IfModule mod_filter.c>
  696. AddOutputFilterByType DEFLATE "application/atom+xml" \
  697. "application/javascript" \
  698. "application/json" \
  699. "application/ld+json" \
  700. "application/manifest+json" \
  701. "application/rdf+xml" \
  702. "application/rss+xml" \
  703. "application/schema+json" \
  704. "application/geo+json" \
  705. "application/vnd.ms-fontobject" \
  706. "application/wasm" \
  707. "application/x-font-ttf" \
  708. "application/x-javascript" \
  709. "application/x-web-app-manifest+json" \
  710. "application/xhtml+xml" \
  711. "application/xml" \
  712. "font/eot" \
  713. "font/opentype" \
  714. "font/otf" \
  715. "font/ttf" \
  716. "image/bmp" \
  717. "image/svg+xml" \
  718. "image/vnd.microsoft.icon" \
  719. "text/cache-manifest" \
  720. "text/calendar" \
  721. "text/css" \
  722. "text/html" \
  723. "text/javascript" \
  724. "text/plain" \
  725. "text/markdown" \
  726. "text/vcard" \
  727. "text/vnd.rim.location.xloc" \
  728. "text/vtt" \
  729. "text/x-component" \
  730. "text/x-cross-domain-policy" \
  731. "text/xml"
  732. </IfModule>
  733. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  734. # Map the following filename extensions to the specified encoding type in
  735. # order to make Apache serve the file types with the appropriate
  736. # `Content-Encoding` response header (do note that this will NOT make
  737. # Apache compress them!).
  738. #
  739. # If these files types would be served without an appropriate
  740. # `Content-Encoding` response header, client applications (e.g.: browsers)
  741. # wouldn't know that they first need to uncompress the response, and thus,
  742. # wouldn't be able to understand the content.
  743. #
  744. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  745. # https://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding
  746. <IfModule mod_mime.c>
  747. AddEncoding gzip svgz
  748. </IfModule>
  749. </IfModule>
  750. # ----------------------------------------------------------------------
  751. # | Brotli pre-compressed content |
  752. # ----------------------------------------------------------------------
  753. # Serve brotli compressed CSS, JS, HTML, SVG, ICS and JSON files if they exist
  754. # and if the client accepts br encoding.
  755. #
  756. # (!) To make this part relevant, you need to generate encoded files by your
  757. # own. Enabling this part will not auto-generate brotlied files.
  758. #
  759. # Note that some clients (eg. browsers) require a secure connection to request
  760. # brotli-compressed resources.
  761. # https://www.chromestatus.com/feature/5420797577396224
  762. #
  763. # https://httpd.apache.org/docs/current/mod/mod_brotli.html#precompressed
  764. # <IfModule mod_headers.c>
  765. # RewriteCond %{HTTP:Accept-Encoding} br
  766. # RewriteCond %{REQUEST_FILENAME}\.br -f
  767. # RewriteRule \.(css|ics|js|json|html|svg)$ %{REQUEST_URI}.br [L]
  768. # # Prevent mod_deflate double gzip
  769. # RewriteRule \.br$ - [E=no-gzip:1]
  770. # <FilesMatch "\.br$">
  771. # <IfModule mod_mime.c>
  772. # # Serve correct content types
  773. # AddType text/css css.br
  774. # AddType text/calendar ics.br
  775. # AddType text/javascript js.br
  776. # AddType application/json json.br
  777. # AddType text/html html.br
  778. # AddType image/svg+xml svg.br
  779. # # Serve correct content charset
  780. # AddCharset utf-8 .css.br \
  781. # .ics.br \
  782. # .js.br \
  783. # .json.br
  784. # </IfModule>
  785. # # Force proxies to cache brotlied and non-brotlied files separately
  786. # Header append Vary Accept-Encoding
  787. # </FilesMatch>
  788. # # Serve correct encoding type
  789. # AddEncoding br .br
  790. # </IfModule>
  791. # ----------------------------------------------------------------------
  792. # | GZip pre-compressed content |
  793. # ----------------------------------------------------------------------
  794. # Serve gzip compressed CSS, JS, HTML, SVG, ICS, and JSON files if they exist
  795. # and if the client accepts gzip encoding.
  796. #
  797. # (!) To make this part relevant, you need to generate encoded files by your
  798. # own. Enabling this part will not auto-generate gziped files.
  799. #
  800. # https://httpd.apache.org/docs/current/mod/mod_deflate.html#precompressed
  801. #
  802. # (1) Removing default MIME Type for .gz files allowing to add custom
  803. # sub-types.
  804. # You may prefer using less generic extensions such as .html_gz in order to
  805. # keep the default behavior regarding .gz files.
  806. # https://httpd.apache.org/docs/current/mod/mod_mime.html#removetype
  807. # <IfModule mod_headers.c>
  808. # RewriteCond %{HTTP:Accept-Encoding} gzip
  809. # RewriteCond %{REQUEST_FILENAME}\.gz -f
  810. # RewriteRule \.(css|ics|js|json|html|svg)$ %{REQUEST_URI}.gz [L]
  811. # # Prevent mod_deflate double gzip
  812. # RewriteRule \.gz$ - [E=no-gzip:1]
  813. # <FilesMatch "\.gz$">
  814. # # Serve correct content types
  815. # <IfModule mod_mime.c>
  816. # # (1)
  817. # RemoveType gz
  818. # # Serve correct content types
  819. # AddType text/css css.gz
  820. # AddType text/calendar ics.gz
  821. # AddType text/javascript js.gz
  822. # AddType application/json json.gz
  823. # AddType text/html html.gz
  824. # AddType image/svg+xml svg.gz
  825. # # Serve correct content charset
  826. # AddCharset utf-8 .css.gz \
  827. # .ics.gz \
  828. # .js.gz \
  829. # .json.gz
  830. # </IfModule>
  831. # # Force proxies to cache gzipped and non-gzipped files separately
  832. # Header append Vary Accept-Encoding
  833. # </FilesMatch>
  834. # # Serve correct encoding type
  835. # AddEncoding gzip .gz
  836. # </IfModule>
  837. # ----------------------------------------------------------------------
  838. # | Content transformation |
  839. # ----------------------------------------------------------------------
  840. # Prevent intermediate caches or proxies (such as those used by mobile
  841. # network providers) and browsers data-saving features from modifying
  842. # the website's content using the `cache-control: no-transform` directive.
  843. #
  844. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
  845. # https://tools.ietf.org/html/rfc7234#section-5.2.2.4
  846. #
  847. # (!) Carefully consider the impact on your visitors before disabling
  848. # content transformation. These transformations are performed to
  849. # improve the experience for data- and cost-constrained users
  850. # (e.g. users on a 2G connection).
  851. #
  852. # You can test the effects of content transformation applied by
  853. # Google's Lite Mode by visiting: https://googleweblight.com/i?u=https://www.example.com
  854. #
  855. # https://support.google.com/webmasters/answer/6211428
  856. #
  857. # (!) If you are using `mod_pagespeed`, note that disabling this will
  858. # prevent `PageSpeed` from rewriting HTML files, and, if the
  859. # `ModPagespeedDisableRewriteOnNoTransform` directive isn't set to
  860. # `off`, also from rewriting other resources.
  861. #
  862. # https://developers.google.com/speed/pagespeed/module/configuration#notransform
  863. # <IfModule mod_headers.c>
  864. # Header merge Cache-Control "no-transform"
  865. # </IfModule>
  866. # ----------------------------------------------------------------------
  867. # | ETags |
  868. # ----------------------------------------------------------------------
  869. # Remove `ETags` as resources are sent with far-future expires headers.
  870. #
  871. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
  872. # https://developer.yahoo.com/performance/rules.html#etags
  873. # https://tools.ietf.org/html/rfc7232#section-2.3
  874. # `FileETag None` doesn't work in all cases.
  875. <IfModule mod_headers.c>
  876. Header unset ETag
  877. </IfModule>
  878. FileETag None
  879. # ----------------------------------------------------------------------
  880. # | Cache expiration |
  881. # ----------------------------------------------------------------------
  882. # Serve resources with a far-future expiration date.
  883. #
  884. # (!) If you don't control versioning with filename-based cache busting, you
  885. # should consider lowering the cache times to something like one week.
  886. #
  887. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
  888. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires
  889. # https://httpd.apache.org/docs/current/mod/mod_expires.html
  890. <IfModule mod_expires.c>
  891. ExpiresActive on
  892. ExpiresDefault "access plus 1 month"
  893. # CSS
  894. ExpiresByType text/css "access plus 1 year"
  895. # Data interchange
  896. ExpiresByType application/atom+xml "access plus 1 hour"
  897. ExpiresByType application/rdf+xml "access plus 1 hour"
  898. ExpiresByType application/rss+xml "access plus 1 hour"
  899. ExpiresByType application/json "access plus 0 seconds"
  900. ExpiresByType application/ld+json "access plus 0 seconds"
  901. ExpiresByType application/schema+json "access plus 0 seconds"
  902. ExpiresByType application/geo+json "access plus 0 seconds"
  903. ExpiresByType application/xml "access plus 0 seconds"
  904. ExpiresByType text/calendar "access plus 0 seconds"
  905. ExpiresByType text/xml "access plus 0 seconds"
  906. # Favicon (cannot be renamed!) and cursor images
  907. ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
  908. ExpiresByType image/x-icon "access plus 1 week"
  909. # HTML
  910. ExpiresByType text/html "access plus 0 seconds"
  911. # JavaScript
  912. ExpiresByType application/javascript "access plus 1 year"
  913. ExpiresByType application/x-javascript "access plus 1 year"
  914. ExpiresByType text/javascript "access plus 1 year"
  915. # Manifest files
  916. ExpiresByType application/manifest+json "access plus 1 week"
  917. ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
  918. ExpiresByType text/cache-manifest "access plus 0 seconds"
  919. # Markdown
  920. ExpiresByType text/markdown "access plus 0 seconds"
  921. # Media files
  922. ExpiresByType audio/ogg "access plus 1 month"
  923. ExpiresByType image/apng "access plus 1 month"
  924. ExpiresByType image/bmp "access plus 1 month"
  925. ExpiresByType image/gif "access plus 1 month"
  926. ExpiresByType image/jpeg "access plus 1 month"
  927. ExpiresByType image/png "access plus 1 month"
  928. ExpiresByType image/svg+xml "access plus 1 month"
  929. ExpiresByType image/webp "access plus 1 month"
  930. ExpiresByType video/mp4 "access plus 1 month"
  931. ExpiresByType video/ogg "access plus 1 month"
  932. ExpiresByType video/webm "access plus 1 month"
  933. # WebAssembly
  934. ExpiresByType application/wasm "access plus 1 year"
  935. # Web fonts
  936. # Collection
  937. ExpiresByType font/collection "access plus 1 month"
  938. # Embedded OpenType (EOT)
  939. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  940. ExpiresByType font/eot "access plus 1 month"
  941. # OpenType
  942. ExpiresByType font/opentype "access plus 1 month"
  943. ExpiresByType font/otf "access plus 1 month"
  944. # TrueType
  945. ExpiresByType application/x-font-ttf "access plus 1 month"
  946. ExpiresByType font/ttf "access plus 1 month"
  947. # Web Open Font Format (WOFF) 1.0
  948. ExpiresByType application/font-woff "access plus 1 month"
  949. ExpiresByType application/x-font-woff "access plus 1 month"
  950. ExpiresByType font/woff "access plus 1 month"
  951. # Web Open Font Format (WOFF) 2.0
  952. ExpiresByType application/font-woff2 "access plus 1 month"
  953. ExpiresByType font/woff2 "access plus 1 month"
  954. # Other
  955. ExpiresByType text/x-cross-domain-policy "access plus 1 week"
  956. </IfModule>
  957. # ----------------------------------------------------------------------
  958. # | File concatenation |
  959. # ----------------------------------------------------------------------
  960. # Allow concatenation from within specific files.
  961. #
  962. # If you have the following lines in a file called, for example,
  963. # `main.combined.js`:
  964. #
  965. # <!--#include file="js/jquery.js" -->
  966. # <!--#include file="js/jquery.timer.js" -->
  967. #
  968. # Apache will replace those lines with the content of the specified files.
  969. # <IfModule mod_include.c>
  970. # <FilesMatch "\.combined\.js$">
  971. # Options +Includes
  972. # AddOutputFilterByType INCLUDES application/javascript \
  973. # application/x-javascript \
  974. # text/javascript
  975. # SetOutputFilter INCLUDES
  976. # </FilesMatch>
  977. # <FilesMatch "\.combined\.css$">
  978. # Options +Includes
  979. # AddOutputFilterByType INCLUDES text/css
  980. # SetOutputFilter INCLUDES
  981. # </FilesMatch>
  982. # </IfModule>
  983. # ----------------------------------------------------------------------
  984. # | Filename-based cache busting |
  985. # ----------------------------------------------------------------------
  986. # If you're not using a build process to manage your filename version revving,
  987. # you might want to consider enabling the following directives.
  988. #
  989. # To understand why this is important and even a better solution than using
  990. # something like `*.css?v231`, please see:
  991. # https://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
  992. # <IfModule mod_rewrite.c>
  993. # RewriteEngine On
  994. # RewriteCond %{REQUEST_FILENAME} !-f
  995. # RewriteRule ^(.+)\.(\w+)\.(bmp|css|cur|gif|ico|jpe?g|m?js|a?png|svgz?|webp|webmanifest)$ $1.$3 [L]
  996. # </IfModule>