.htaccess 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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/buscar/([A-Za-z0-9]+)/([A-Za-z0-9]+)[\/]?$ /blog/buscar.php?where=$1&query=$2 [NC]
  20. RewriteRule ^blog/([A-Z\-a-z0-9]{3,}+)[\/]?$ /blog/post.php?perm=$1 [NC]
  21. RewriteRule ^lablanca/([0-9]+)[\/]?$ /lablanca/index.php?year=$1 [NC]
  22. RewriteRule ^lablanca/programa[\/]?$ /lablanca/programa.php?gm=1 [NC]
  23. RewriteRule ^lablanca/programa/([A-Za-z]+)[\/]?$ /lablanca/programa.php?gm=$1 [NC]
  24. RewriteRule ^lablanca/programa/([A-Za-z]+)/([0-9]+)[\/]?$ /lablanca/programa.php?gm=$1&year=$2 [NC]
  25. RewriteRule ^archivo/([A-Z\-a-z0-9]{3,}+)[\/]?$ /archivo/index.php?file=$1 [NC]
  26. RewriteRule ^actividades/search/([A-Za-z0-9]+)/([A-Za-z0-9]+)[\/]?$ /actividades/buscar.php?where=$1&query=$2 [NC]
  27. RewriteRule ^actividades/([A-Z\-a-z0-9{3,}]+)[\/]?$ /actividades/actividad.php?perm=$1 [NC]
  28. RewriteRule ^ayuda[\/]?$ /ayuda/index.php [NC]
  29. RewriteRule ^galeria/upload[\/]?$ /galeria/upload.php [NC]
  30. RewriteRule ^galeria/([A-Z\-a-z0-9{3,}]+)[\/]?$ /galeria/album.php?perm=$1 [NC]
  31. RewriteRule ^galeria/([A-Z\-a-z0-9{3,}]+)/([A-Z\-a-z0-9{3,}]+)[\/]?$ /galeria/photo.php?album=$2&perm=$1 [NC]
  32. RewriteRule ^traducir/eu[\/]?$ /traducir/index.php?l=eu [NC]
  33. RewriteRule ^traducir/en[\/]?$ /traducir/index.php?l=en [NC]
  34. #API redirections
  35. #TODO: This changes the url in the browser
  36. RewriteRule ^API/V([{0-9}]+)/help/([A-Z\-a-z0-9{3,}]+)$ /API/V$1/help/$2.php [NC,QSA,L]
  37. RewriteRule ^API/V([{0-9}]+)/help/([A-Z\-a-z0-9{3,}]+)/$ /API/V$1/help/$2.php [L,NC]
  38. #Force https TODO
  39. RewriteCond %{HTTPS} !=on
  40. RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
  41. # BEGIN Cache-Control Headers
  42. <IfModule mod_expires.c>
  43. ExpiresActive on
  44. # ExpiresDefault "access plus 1 month"
  45. ExpiresByType application/javascript "access plus 6 days"
  46. ExpiresByType image/x-ico "access plus 12 days"
  47. ExpiresByType image/jpg "access plus 12 days"
  48. ExpiresByType image/jpeg "access plus 12 days"
  49. ExpiresByType image/gif "access plus 12 days"
  50. ExpiresByType image/png "access plus 12 days"
  51. ExpiresByType video/mkv "access plus 12 days"
  52. ExpiresByType text/css "access plus 6 days"
  53. ExpiresByType text/plain "access plus 6 days"
  54. </IfModule>
  55. # BEGIN Cache-Control Headers
  56. <ifModule mod_headers.c>
  57. <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
  58. Header set Cache-Control "max-age=864000, public, must-revalidate"
  59. </filesMatch>
  60. <filesMatch "\.(css)$">
  61. Header set Cache-Control "max-age=864000, public, must-revalidate"
  62. </filesMatch>
  63. <filesMatch "\.(js)$">
  64. Header set Cache-Control "max-age=864000, private, must-revalidate"
  65. </filesMatch>
  66. <filesMatch "\.(x?html?|php)$">
  67. Header set Cache-Control "max-age=86400, private, must-revalidate"
  68. </filesMatch>
  69. </ifModule>
  70. # END Cache-Control Headers
  71. <ifModule mod_deflate.c>
  72. AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
  73. AddOutputFilterByType DEFLATE image/x-icon
  74. AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
  75. AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
  76. AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
  77. AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
  78. AddOutputFilterByType DEFLATE font/truetype font/opentype
  79. </ifModule>
  80. # Enable memory caching
  81. #CacheEnable mem /
  82. # Limit the size of the cache to 1 Megabyte
  83. #MCacheSize 1024
  84. #CacheFile footer.php header.php img/*/*/*.jpg