Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <IfModule mod_headers.c>
  2. <IfModule mod_setenvif.c>
  3. <IfModule mod_fcgid.c>
  4. SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
  5. RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
  6. </IfModule>
  7. <IfModule mod_proxy_fcgi.c>
  8. SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
  9. </IfModule>
  10. </IfModule>
  11.  
  12. <IfModule mod_env.c>
  13. # Add security and privacy related headers
  14. Header always set Referrer-Policy "no-referrer"
  15. Header always set X-Content-Type-Options "nosniff"
  16. Header always set X-Download-Options "noopen"
  17. Header always set X-Frame-Options "SAMEORIGIN"
  18. Header always set X-Permitted-Cross-Domain-Policies "none"
  19. Header always set X-Robots-Tag "none"
  20. Header always set X-XSS-Protection "1; mode=block"
  21. SetEnv modHeadersAvailable true
  22. </IfModule>
  23.  
  24. # Add cache control for static resources
  25. <FilesMatch "\.(css|js|svg|gif)$">
  26. Header set Cache-Control "max-age=15778463"
  27. </FilesMatch>
  28.  
  29. # Let browsers cache WOFF files for a week
  30. <FilesMatch "\.woff2?$">
  31. Header set Cache-Control "max-age=604800"
  32. </FilesMatch>
  33. </IfModule>
  34. <IfModule mod_php7.c>
  35. php_value mbstring.func_overload 0
  36. php_value default_charset 'UTF-8'
  37. php_value output_buffering 0
  38. <IfModule mod_env.c>
  39. SetEnv htaccessWorking true
  40. </IfModule>
  41. </IfModule>
  42. <IfModule mod_rewrite.c>
  43. RewriteEngine on
  44. RewriteCond %{HTTP_USER_AGENT} DavClnt
  45. RewriteRule ^$ /remote.php/webdav/ [L,R=302]
  46. RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  47. RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  48. RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  49. RewriteRule ^\.well-known/webfinger /public.php?service=webfinger [QSA,L]
  50. RewriteRule ^\.well-known/nodeinfo /public.php?service=nodeinfo [QSA,L]
  51. RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  52. RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  53. RewriteRule ^remote/(.*) remote.php [QSA,L]
  54. RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  55. RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/.*
  56. RewriteRule ^(?:\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
  57. </IfModule>
  58. <IfModule mod_mime.c>
  59. AddType image/svg+xml svg svgz
  60. AddEncoding gzip svgz
  61. </IfModule>
  62. <IfModule mod_dir.c>
  63. DirectoryIndex index.php index.html
  64. </IfModule>
  65. AddDefaultCharset utf-8
  66. Options -Indexes
  67. <IfModule pagespeed_module>
  68. ModPagespeed Off
  69. </IfModule>
  70. #### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####
  71.  
  72. ErrorDocument 403 /
  73. ErrorDocument 404 /
  74. <IfModule mod_rewrite.c>
  75. Options -MultiViews
  76. # This is my test attempt for rewrite
  77. #RewriteRule ^files/work$ /s/wt4HA97SdQkF7CR [QSA]
  78. # Attempt ends here ... no success
  79. RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
  80. RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
  81. RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map)$
  82. RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
  83. RewriteCond %{REQUEST_FILENAME} !core/img/manifest.json$
  84. RewriteCond %{REQUEST_FILENAME} !/remote.php
  85. RewriteCond %{REQUEST_FILENAME} !/public.php
  86. RewriteCond %{REQUEST_FILENAME} !/cron.php
  87. RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
  88. RewriteCond %{REQUEST_FILENAME} !/status.php
  89. RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
  90. RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
  91. RewriteCond %{REQUEST_FILENAME} !/robots.txt
  92. RewriteCond %{REQUEST_FILENAME} !/updater/
  93. RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
  94. RewriteCond %{REQUEST_FILENAME} !/ocm-provider/
  95. RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/.*
  96. RewriteRule . index.php [PT,E=PATH_INFO:$1]
  97. RewriteBase /
  98. <IfModule mod_env.c>
  99. SetEnv front_controller_active true
  100. <IfModule mod_dir.c>
  101. DirectorySlash off
  102. </IfModule>
  103. </IfModule>
  104. </IfModule>
Advertisement
RAW Paste Data Copied
Advertisement