.htaccess 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #RewriteMap lc int:tolower
  2. ErrorDocument 403 /error/403.php
  3. ErrorDocument 404 /error/404.php
  4. ErrorDocument 500 /error/500.php
  5. #AddHandler application/x-httpd-php .xml
  6. #AddType application/x-httpd-php .xml
  7. AddType application/x-httpd-php .xml
  8. AddHandler php5-cgi .xml
  9. # <FilesMatch "\.php$">
  10. # Order allow, deny
  11. # Deny from all
  12. # </FilesMatch>
  13. Options +FollowSymlinks
  14. RewriteEngine on
  15. CheckSpelling on
  16. RewriteRule ^sitemap.xml$ /sitemap.php [NC]
  17. RewriteRule ^imgmap.xml$ /sitemap-image.php [NC]
  18. RewriteRule ^rss.xml$ /rss.php [NC]
  19. RewriteRule ^blog/([A-Z\-a-z0-9]{3,}+)[\/]?$ /blog/post.php?permalink=$1 [NC]
  20. RewriteRule ^project/([A-Z\-a-z0-9]{3,}+)[\/]?$ /project/project.php?permalink=$1 [NC]
  21. RewriteRule ^help[\/]?$ /help/index.php [NC]
  22. #Force https
  23. RewriteCond %{HTTPS} !=on
  24. RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
  25. # BEGIN Cache-Control Headers
  26. <IfModule mod_expires.c>
  27. ExpiresActive on
  28. # ExpiresDefault "access plus 1 month"
  29. ExpiresByType application/javascript "access plus 6 days"
  30. ExpiresByType image/x-ico "access plus 12 days"
  31. ExpiresByType image/jpg "access plus 12 days"
  32. ExpiresByType image/jpeg "access plus 12 days"
  33. ExpiresByType image/gif "access plus 12 days"
  34. ExpiresByType image/png "access plus 12 days"
  35. ExpiresByType video/mkv "access plus 12 days"
  36. ExpiresByType text/css "access plus 6 days"
  37. ExpiresByType text/plain "access plus 6 days"
  38. </IfModule>
  39. # BEGIN Cache-Control Headers
  40. <ifModule mod_headers.c>
  41. <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
  42. Header set Cache-Control "max-age=864000, public, must-revalidate"
  43. </filesMatch>
  44. <filesMatch "\.(css)$">
  45. Header set Cache-Control "max-age=864000, public, must-revalidate"
  46. </filesMatch>
  47. <filesMatch "\.(js)$">
  48. Header set Cache-Control "max-age=864000, private, must-revalidate"
  49. </filesMatch>
  50. <filesMatch "\.(x?html?|php)$">
  51. Header set Cache-Control "max-age=86400, private, must-revalidate"
  52. </filesMatch>
  53. </ifModule>
  54. # END Cache-Control Headers
  55. <ifModule mod_deflate.c>
  56. AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
  57. AddOutputFilterByType DEFLATE image/x-icon
  58. AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
  59. AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
  60. AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
  61. AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
  62. AddOutputFilterByType DEFLATE font/truetype font/opentype
  63. </ifModule>
  64. # Enable memory caching
  65. #CacheEnable mem /
  66. # Limit the size of the cache to 1 Megabyte
  67. #MCacheSize 1024
  68. #CacheFile footer.php header.php img/*/*/*.jpg