You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.htaccess 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <IfModule mod_headers.c>
  2. <IfModule mod_fcgid.c>
  3. <IfModule mod_setenvif.c>
  4. SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
  5. RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
  6. </IfModule>
  7. </IfModule>
  8. <IfModule mod_env.c>
  9. # Add security and privacy related headers
  10. Header set X-Content-Type-Options "nosniff"
  11. Header set X-XSS-Protection "1; mode=block"
  12. Header set X-Robots-Tag "none"
  13. Header set X-Frame-Options "SAMEORIGIN"
  14. SetEnv modHeadersAvailable true
  15. # Add CSP header if not set, used for static resources
  16. Header append Content-Security-Policy ""
  17. Header edit Content-Security-Policy "^$" "default-src 'none'; style-src 'self' 'unsafe-inline'; script-src 'self'"
  18. </IfModule>
  19. # Add cache control for CSS and JS files
  20. <FilesMatch "\.(css|js)$">
  21. Header set Cache-Control "max-age=7200, public"
  22. </FilesMatch>
  23. </IfModule>
  24. <IfModule mod_php5.c>
  25. php_value upload_max_filesize 513M
  26. php_value post_max_size 513M
  27. php_value memory_limit 512M
  28. php_value mbstring.func_overload 0
  29. php_value always_populate_raw_post_data -1
  30. php_value default_charset 'UTF-8'
  31. php_value output_buffering 0
  32. <IfModule mod_env.c>
  33. SetEnv htaccessWorking true
  34. </IfModule>
  35. </IfModule>
  36. <IfModule mod_rewrite.c>
  37. RewriteEngine on
  38. RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  39. RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  40. RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  41. RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  42. RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  43. RewriteRule ^remote/(.*) remote.php [QSA,L]
  44. RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  45. RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  46. RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
  47. # Rewrite rules for `front_controller_active`
  48. Options -MultiViews
  49. RewriteRule ^core/js/oc.js$ index.php/core/js/oc.js [PT,E=PATH_INFO:$1]
  50. RewriteRule ^core/preview.png$ index.php/core/preview.png [PT,E=PATH_INFO:$1]
  51. RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff|ico)$
  52. RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
  53. RewriteCond %{REQUEST_FILENAME} !/remote.php
  54. RewriteCond %{REQUEST_FILENAME} !/public.php
  55. RewriteCond %{REQUEST_FILENAME} !/cron.php
  56. RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
  57. RewriteCond %{REQUEST_FILENAME} !/status.php
  58. RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
  59. RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
  60. RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  61. RewriteRule .* index.php [PT,E=PATH_INFO:$1]
  62. </IfModule>
  63. <IfModule mod_mime.c>
  64. AddType image/svg+xml svg svgz
  65. AddEncoding gzip svgz
  66. </IfModule>
  67. <IfModule mod_dir.c>
  68. DirectoryIndex index.php index.html
  69. </IfModule>
  70. AddDefaultCharset utf-8
  71. Options -Indexes
  72. <IfModule pagespeed_module>
  73. ModPagespeed Off
  74. </IfModule>