.htaccess 4.0 KB

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