.htaccess 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <ifModule mod_rewrite.c>
  2. #######################################################################
  3. # GENERAL #
  4. #######################################################################
  5. # Make apache follow sym links to files
  6. Options +FollowSymLinks
  7. # If somebody opens a folder, hide all files from the resulting folder list
  8. IndexIgnore */*
  9. #######################################################################
  10. # REWRITING #
  11. #######################################################################
  12. # Enable rewriting
  13. RewriteEngine On
  14. # If its not HTTPS
  15. RewriteCond %{HTTPS} off
  16. # Comment out the RewriteCond above, and uncomment the RewriteCond below if you're using a load balancer (e.g. CloudFlare) for SSL
  17. # RewriteCond %{HTTP:X-Forwarded-Proto} !https
  18. # Redirect to the same URL with https://, ignoring all further rules if this one is in effect
  19. RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [R,L]
  20. # If we get to here, it means we are on https://
  21. # If the file with the specified name in the browser doesn't exist
  22. RewriteCond %{REQUEST_FILENAME} !-f
  23. # and the directory with the specified name in the browser doesn't exist
  24. RewriteCond %{REQUEST_FILENAME} !-d
  25. # and we are not opening the root already (otherwise we get a redirect loop)
  26. RewriteCond %{REQUEST_FILENAME} !\/$
  27. # Rewrite all requests to the root
  28. RewriteRule ^(.*) /
  29. </ifModule>
  30. <IfModule mod_headers.c>
  31. # Do not cache sw.js, required for offline-first updates.
  32. <FilesMatch "sw\.js$">
  33. Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
  34. Header set Pragma "no-cache"
  35. </FilesMatch>
  36. </IfModule>