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. <IfModule mod_rewrite.c>
  13. RewriteEngine on
  14.  
  15. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  16.  
  17. RewriteRule ^vendor/(.*)?$ / [F,L]
  18. RewriteRule ^storage/(.*)?$ / [F,L]
  19. RewriteRule ^config.php$ / [F,L]
  20.  
  21. RewriteRule ^api(.*)$ api.php [QSA,L]
  22. RewriteRule ^admin(.*)$ admin.php [QSA,L]
  23.  
  24. RewriteCond %{REQUEST_FILENAME} !-f
  25. RewriteCond %{REQUEST_FILENAME} !-d
  26. RewriteRule !^assets index.php [QSA,L]
  27.  
  28. # MultiViews can mess up our rewriting scheme
  29. Options -MultiViews
  30.  
  31. # Autoindex will list all assets files which is not so good
  32. Options -Indexes
  33. </IfModule>
  34.  
  35. <IfModule mod_deflate.c>
  36. # Compress all output labeled with one of the following MIME-types
  37. <IfModule mod_filter.c>
  38. AddOutputFilterByType DEFLATE application/atom+xml \
  39. application/javascript \
  40. application/json \
  41. application/vnd.ms-fontobject \
  42. application/x-font-ttf \
  43. application/x-web-app-manifest+json \
  44. application/xhtml+xml \
  45. application/xml \
  46. font/opentype \
  47. image/svg+xml \
  48. image/x-icon \
  49. text/css \
  50. text/html \
  51. text/plain \
  52. text/xml
  53. </IfModule>
  54. </IfModule>
  55.  
  56. # Configure cache expiry for different file types
  57. <IfModule mod_expires.c>
  58. ExpiresActive on
  59. ExpiresDefault "access plus 1 second"
  60.  
  61. ExpiresByType text/css "access plus 1 year"
  62. ExpiresByType application/json "access plus 0 seconds"
  63. ExpiresByType application/xml "access plus 0 seconds"
  64. ExpiresByType text/xml "access plus 0 seconds"
  65. ExpiresByType image/x-icon "access plus 1 week"
  66. ExpiresByType text/html "access plus 0 seconds"
  67. ExpiresByType application/javascript "access plus 1 year"
  68. ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
  69. ExpiresByType text/cache-manifest "access plus 0 seconds"
  70. ExpiresByType image/gif "access plus 1 month"
  71. ExpiresByType image/jpeg "access plus 1 month"
  72. ExpiresByType image/png "access plus 1 month"
  73. ExpiresByType application/atom+xml "access plus 1 hour"
  74. ExpiresByType application/rss+xml "access plus 1 hour"
  75. ExpiresByType application/font-woff2 "access plus 1 month"
  76. ExpiresByType application/font-woff "access plus 1 month"
  77. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  78. ExpiresByType application/x-font-ttf "access plus 1 month"
  79. ExpiresByType font/opentype "access plus 1 month"
  80. ExpiresByType image/svg+xml "access plus 1 month"
  81. </IfModule>