Advertisement
Justman10000

UltimateFlarumMaster | .htaccess

Dec 15th, 2021
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.98 KB | None
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine on
  3.  
  4. # Ensure the Authorization HTTP header is available to PHP
  5. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  6.  
  7. # Uncomment the following lines if you are not using a `public` directory
  8. # to prevent sensitive resources from being exposed.
  9. RewriteRule /\.git / [F,L]
  10. RewriteRule ^auth\.json$ / [F,L]
  11. RewriteRule ^composer\.(lock|json)$ / [F,L]
  12. RewriteRule ^config.php$ / [F,L]
  13. RewriteRule ^flarum$ / [F,L]
  14. RewriteRule ^storage/(.*)?$ / [F,L]
  15. RewriteRule ^vendor/(.*)?$ / [F,L]
  16.  
  17. # Pass requests that don't refer directly to files in the filesystem to index.php
  18. RewriteCond %{REQUEST_FILENAME} !-f
  19. RewriteCond %{REQUEST_FILENAME} !-d
  20. RewriteRule ^ index.php [QSA,L]
  21. </IfModule>
  22.  
  23. # Disable directory listings
  24. Options -Indexes
  25.  
  26. # MultiViews can mess up our rewriting scheme
  27. Options -MultiViews
  28.  
  29. # The following directives are based on best practices from H5BP Apache Server Configs
  30. # https://github.com/h5bp/server-configs-apache
  31.  
  32. # Expire rules for static content
  33. <IfModule mod_expires.c>
  34. ExpiresActive on
  35. ExpiresDefault "access plus 1 month"
  36. ExpiresByType text/css "access plus 1 year"
  37. ExpiresByType application/atom+xml "access plus 1 hour"
  38. ExpiresByType application/rdf+xml "access plus 1 hour"
  39. ExpiresByType application/rss+xml "access plus 1 hour"
  40. ExpiresByType application/json "access plus 0 seconds"
  41. ExpiresByType application/ld+json "access plus 0 seconds"
  42. ExpiresByType application/schema+json "access plus 0 seconds"
  43. ExpiresByType application/vnd.geo+json "access plus 0 seconds"
  44. ExpiresByType application/vnd.api+json "access plus 0 seconds"
  45. ExpiresByType application/xml "access plus 0 seconds"
  46. ExpiresByType text/calendar "access plus 0 seconds"
  47. ExpiresByType text/xml "access plus 0 seconds"
  48. ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
  49. ExpiresByType image/x-icon "access plus 1 week"
  50. ExpiresByType text/html "access plus 0 seconds"
  51. ExpiresByType application/javascript "access plus 1 year"
  52. ExpiresByType application/x-javascript "access plus 1 year"
  53. ExpiresByType text/javascript "access plus 1 year"
  54. ExpiresByType application/manifest+json "access plus 1 week"
  55. ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
  56. ExpiresByType text/cache-manifest "access plus 0 seconds"
  57. ExpiresByType text/markdown "access plus 0 seconds"
  58. ExpiresByType audio/ogg "access plus 1 month"
  59. ExpiresByType image/bmp "access plus 1 month"
  60. ExpiresByType image/gif "access plus 1 month"
  61. ExpiresByType image/jpeg "access plus 1 month"
  62. ExpiresByType image/png "access plus 1 month"
  63. ExpiresByType image/svg+xml "access plus 1 month"
  64. ExpiresByType image/webp "access plus 1 month"
  65. ExpiresByType video/mp4 "access plus 1 month"
  66. ExpiresByType video/ogg "access plus 1 month"
  67. ExpiresByType video/webm "access plus 1 month"
  68. ExpiresByType application/wasm "access plus 1 year"
  69. ExpiresByType font/collection "access plus 1 month"
  70. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  71. ExpiresByType font/eot "access plus 1 month"
  72. ExpiresByType font/opentype "access plus 1 month"
  73. ExpiresByType font/otf "access plus 1 month"
  74. ExpiresByType application/x-font-ttf "access plus 1 month"
  75. ExpiresByType font/ttf "access plus 1 month"
  76. ExpiresByType application/font-woff "access plus 1 month"
  77. ExpiresByType application/x-font-woff "access plus 1 month"
  78. ExpiresByType font/woff "access plus 1 month"
  79. ExpiresByType application/font-woff2 "access plus 1 month"
  80. ExpiresByType font/woff2 "access plus 1 month"
  81. ExpiresByType text/x-cross-domain-policy "access plus 1 week"
  82. </IfModule>
  83.  
  84. # Gzip compression
  85. <IfModule mod_deflate.c>
  86. <IfModule mod_filter.c>
  87. AddOutputFilterByType DEFLATE "application/atom+xml" \
  88. "application/javascript" \
  89. "application/json" \
  90. "application/ld+json" \
  91. "application/manifest+json" \
  92. "application/rdf+xml" \
  93. "application/rss+xml" \
  94. "application/schema+json" \
  95. "application/vnd.geo+json" \
  96. "application/vnd.ms-fontobject" \
  97. "application/wasm" \
  98. "application/x-font-ttf" \
  99. "application/x-javascript" \
  100. "application/x-web-app-manifest+json" \
  101. "application/xhtml+xml" \
  102. "application/xml" \
  103. "font/collection" \
  104. "font/eot" \
  105. "font/opentype" \
  106. "font/otf" \
  107. "font/ttf" \
  108. "image/bmp" \
  109. "image/svg+xml" \
  110. "image/vnd.microsoft.icon" \
  111. "image/x-icon" \
  112. "text/cache-manifest" \
  113. "text/calendar" \
  114. "text/css" \
  115. "text/html" \
  116. "text/javascript" \
  117. "text/plain" \
  118. "text/markdown" \
  119. "text/vcard" \
  120. "text/vnd.rim.location.xloc" \
  121. "text/vtt" \
  122. "text/x-component" \
  123. "text/x-cross-domain-policy" \
  124. "text/xml"
  125. </IfModule>
  126. </IfModule>
  127.  
  128. # Fix for https://httpoxy.org vulnerability
  129. <IfModule mod_headers.c>
  130. RequestHeader unset Proxy
  131. </IfModule>
Advertisement
RAW Paste Data Copied
Advertisement