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.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. </IfModule>
  16. # Add cache control for CSS and JS files
  17. <FilesMatch "\.(css|js)$">
  18. Header set Cache-Control "max-age=7200, public"
  19. </FilesMatch>
  20. </IfModule>
  21. <IfModule mod_php5.c>
  22. php_value upload_max_filesize 513M
  23. php_value post_max_size 513M
  24. php_value memory_limit 512M
  25. php_value mbstring.func_overload 0
  26. php_value always_populate_raw_post_data -1
  27. php_value default_charset 'UTF-8'
  28. php_value output_buffering 0
  29. <IfModule mod_env.c>
  30. SetEnv htaccessWorking true
  31. </IfModule>
  32. </IfModule>
  33. <IfModule mod_rewrite.c>
  34. RewriteEngine on
  35. RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  36. RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  37. RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  38. RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  39. RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  40. RewriteRule ^remote/(.*) remote.php [QSA,L]
  41. RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  42. RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  43. RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
  44. # Rewrite rules for `front_controller_active`
  45. Options -MultiViews
  46. RewriteRule ^core/js/oc.js$ index.php/core/js/oc.js [PT,E=PATH_INFO:$1]
  47. RewriteRule ^core/preview.png$ index.php/core/preview.png [PT,E=PATH_INFO:$1]
  48. RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff|ico)$
  49. RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
  50. RewriteCond %{REQUEST_FILENAME} !/remote.php
  51. RewriteCond %{REQUEST_FILENAME} !/public.php
  52. RewriteCond %{REQUEST_FILENAME} !/cron.php
  53. RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
  54. RewriteCond %{REQUEST_FILENAME} !/status.php
  55. RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
  56. RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
  57. RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  58. RewriteRule .* index.php [PT,E=PATH_INFO:$1]
  59. </IfModule>
  60. <IfModule mod_mime.c>
  61. AddType image/svg+xml svg svgz
  62. AddEncoding gzip svgz
  63. </IfModule>
  64. <IfModule mod_dir.c>
  65. DirectoryIndex index.php index.html
  66. </IfModule>
  67. AddDefaultCharset utf-8
  68. Options -Indexes
  69. <IfModule pagespeed_module>
  70. ModPagespeed Off
  71. </IfModule>