Advertisement
Guest User

Forum .htaccess

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