2.13.7.3. Standard .htaccess for Webasyst

The content of the standard .htaccess for Webasyst (GitHub):

  1. <FilesMatch "\.md5$">
  2. Deny from all
  3. </FilesMatch>
  4.  
  5. DirectoryIndex index.php
  6. Options -Indexes
  7. # Comment the following line, if option Multiviews not allowed here
  8. Options -MultiViews
  9.  
  10. AddDefaultCharset utf-8
  11.  
  12. <ifModule mod_rewrite.c>
  13. RewriteEngine On
  14.  
  15. # Uncomment the following line, if you are having trouble
  16. #RewriteBase /
  17.  
  18. # if request js file from ROOT
  19. RewriteCond %{REQUEST_URI} ^\/?[^\/]+\.js$ [or]
  20. # or if NOT request certain static file from anywhere
  21. RewriteCond %{REQUEST_URI} !\.(js|css|jpg|jpeg|gif|png|svg|ttf|eot|otf|woff|woff2)$ [or]
  22. # or if request apple-touch-icon.png icon
  23. RewriteCond %{REQUEST_URI} apple-touch-icon\.png$ [or]
  24.  
  25. # or if other conditions for webdav and caldav are passed
  26. RewriteCond %{REQUEST_METHOD} ^(POST|PUT|COPY|MOVE|DELETE|PROPFIND|OPTIONS|MKCOL)$ [or]
  27. RewriteCond %{HTTP:Translate} ^.+$ [or]
  28. RewriteCond %{HTTP_USER_AGENT} ^(DavClnt|litmus|gvfs|davfs|wdfs|WebDAV|cadaver|Cyberduck)
  29.  
  30. # or if file doesnt' exist
  31. RewriteCond %{REQUEST_FILENAME} !-f
  32. # or if directory doesnt' exist
  33. RewriteCond %{REQUEST_FILENAME} !-d
  34.  
  35. # dispatch it to index.php
  36. RewriteRule ^(.*)$ index.php [L,QSA]
  37. </ifModule>
  38.  
  39. <ifModule mod_headers.c>
  40. <FilesMatch "\.(jpg|jpeg|png|gif|js|css|svg|ttf|eot|otf|woff|woff2)$">
  41. Header set Cache-Control "max-age=3153600, public"
  42. </FilesMatch>
  43. </ifModule>
Content