Advertisement
Guest User

Untitled

a guest
Sep 27th, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. # Kirby .htaccess
  2.  
  3.  
  4.  
  5. # SET CSP HEADER
  6. <IfModule mod_headers.c>
  7. Header set Content-Security-Policy "upgrade-insecure-requests"
  8. </IfModule>
  9. # HSTS HEADER
  10. # Recommanded value: 15778800 (half a year)
  11. Header always set Strict-Transport-Security "max-age=31557600; includeSubDomains; preload"
  12.  
  13. # rewrite rules
  14. <IfModule mod_rewrite.c>
  15.  
  16. # enable awesome urls. i.e.:
  17. # http://yourdomain.com/about-us/team
  18. RewriteEngine on
  19.  
  20.  
  21.  
  22. RewriteCond %{SERVER_PORT} 80
  23. #RewriteRule ^(.*)$ https://www.marcteyssier.com/$1 [R=301,L]
  24. #RewriteRule ^panel/(.*) https://www.marcteyssier.com/panel/ [R=301,L]
  25.  
  26.  
  27.  
  28. RewriteBase /
  29.  
  30. # block text files in the content folder from being accessed directly
  31. RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]
  32.  
  33. # block all files in the site folder from being accessed directly
  34. # except for requests to plugin assets files
  35. #RewriteRule ^assets/plugins/([a-zA-Z0-9\.\-_%=]+)/(.*)$ site/plugins/$1/assets/$2 [L,N]
  36. #RewriteCond $1 !^plugins/[a-zA-Z0-9\.\-_%=]+/assets/.*
  37. RewriteRule ^site/(.*) index.php [L]
  38.  
  39. # block all files in the kirby folder from being accessed directly
  40. RewriteRule ^kirby/(.*) index.php [L]
  41.  
  42. # make panel links work
  43. RewriteCond %{REQUEST_FILENAME} !-f
  44. RewriteCond %{REQUEST_FILENAME} !-d
  45. RewriteRule ^panel/(.*) panel/index.php [L]
  46.  
  47. # make site links work
  48. RewriteCond %{REQUEST_FILENAME} !-f
  49. RewriteCond %{REQUEST_FILENAME} !-d
  50. RewriteRule ^(.*) index.php [L]
  51.  
  52. </IfModule>
  53.  
  54. # Additional recommended values
  55. # Remove comments for those you want to use.
  56. #
  57. # AddDefaultCharset UTF-8
  58. #
  59. # php_flag short_open_tag on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement