.htaccess 4.7 KB

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