Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. # Allow access if Flarum is installed in a subdirectory,
  2. # but another .htaccess in a higher directory denies access.
  3.  
  4. <IfModule mod_authz_core.c>
  5. Require all granted
  6. </IfModule>
  7. <IfModule !mod_authz_core.c>
  8. Order Allow,Deny
  9. Allow from all
  10. </IfModule>
  11.  
  12. # Fix for https://httpoxy.org vulnerability
  13. Header unset Proxy
  14.  
  15. <IfModule mod_rewrite.c>
  16. RewriteEngine on
  17.  
  18. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  19.  
  20. RewriteRule ^vendor/(.*)?$ / [F,L]
  21. RewriteRule ^storage/(.*)?$ / [F,L]
  22. RewriteRule ^config.php$ / [F,L]
  23. RewriteRule ^.git/(.*)?$ / [F,L]
  24.  
  25. RewriteRule ^api(.*)$ api.php [QSA,L]
  26. RewriteRule ^admin(.*)$ admin.php [QSA,L]
  27.  
  28. RewriteCond %{REQUEST_FILENAME} !-f
  29. RewriteCond %{REQUEST_FILENAME} !-d
  30. RewriteRule !^assets index.php [QSA,L]
  31.  
  32. # MultiViews can mess up our rewriting scheme
  33. Options -MultiViews
  34.  
  35. # Autoindex will list all assets files which is not so good
  36. Options -Indexes
  37. </IfModule>
  38.  
  39. <IfModule mod_deflate.c>
  40. # Compress all output labeled with one of the following MIME-types
  41. <IfModule mod_filter.c>
  42. AddOutputFilterByType DEFLATE application/atom+xml \
  43. application/javascript \
  44. application/json \
  45. application/vnd.ms-fontobject \
  46. application/x-font-ttf \
  47. application/x-web-app-manifest+json \
  48. application/xhtml+xml \
  49. application/xml \
  50. font/opentype \
  51. image/svg+xml \
  52. image/x-icon \
  53. text/css \
  54. text/html \
  55. text/plain \
  56. text/xml
  57. </IfModule>
  58. </IfModule>
  59.  
  60. # Configure cache expiry for different file types
  61. <IfModule mod_expires.c>
  62. ExpiresActive on
  63. ExpiresDefault "access plus 1 second"
  64.  
  65. ExpiresByType text/css "access plus 1 year"
  66. ExpiresByType application/json "access plus 0 seconds"
  67. ExpiresByType application/xml "access plus 0 seconds"
  68. ExpiresByType text/xml "access plus 0 seconds"
  69. ExpiresByType image/x-icon "access plus 1 week"
  70. ExpiresByType text/html "access plus 0 seconds"
  71. ExpiresByType application/javascript "access plus 1 year"
  72. ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
  73. ExpiresByType text/cache-manifest "access plus 0 seconds"
  74. ExpiresByType image/gif "access plus 1 month"
  75. ExpiresByType image/jpeg "access plus 1 month"
  76. ExpiresByType image/png "access plus 1 month"
  77. ExpiresByType application/atom+xml "access plus 1 hour"
  78. ExpiresByType application/rss+xml "access plus 1 hour"
  79. ExpiresByType application/font-woff2 "access plus 1 month"
  80. ExpiresByType application/font-woff "access plus 1 month"
  81. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  82. ExpiresByType application/x-font-ttf "access plus 1 month"
  83. ExpiresByType font/opentype "access plus 1 month"
  84. ExpiresByType image/svg+xml "access plus 1 month"
  85. </IfModule>