DirectoryIndex index.html index.php index.shtml index.htm
Options -Indexes -MultiViews
AddDefaultCharset utf-8

# Prevent PHP/ASP execution — serve as static HTML
# This is critical: restored .php files contain HTML, not PHP code
<IfModule mod_php.c>
  php_flag engine off
</IfModule>
<IfModule mod_php7.c>
  php_flag engine off
</IfModule>
<IfModule mod_php8.c>
  php_flag engine off
</IfModule>
RemoveHandler .php .phtml .php3 .php4 .php5 .php7 .php8
RemoveHandler .asp .aspx .cfm
<IfModule mod_mime.c>
  AddType text/html .html .htm .shtml .php .asp .aspx .cfm
</IfModule>
<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
</IfModule>
RewriteEngine On

# Canonical host redirect
RewriteCond %{HTTP_HOST} !^canyaviva\.org$ [NC]
RewriteRule ^(.*)$ https://canyaviva.org/$1 [L,R=301]

# Serve existing files directly
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

# Query string rewrites (from manifest)
# Maps original ?query URLs to hashed static files
RewriteCond %{QUERY_STRING} ^replytocom=21$
RewriteRule ^2019/04/08/bienvenidos\-a\-canyaviva/$ /2019/04/08/bienvenidos-a-canyaviva-f62db7078a.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=2$
RewriteRule ^2019/04/08/bienvenidos\-a\-canyaviva/$ /2019/04/08/bienvenidos-a-canyaviva-71a89464f7.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=1$
RewriteRule ^2019/04/08/bienvenidos\-a\-canyaviva/$ /2019/04/08/bienvenidos-a-canyaviva-e61b4df5d9.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=10$
RewriteRule ^2019/04/08/bienvenidos\-a\-canyaviva/$ /2019/04/08/bienvenidos-a-canyaviva-02f78ef1f5.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=26$
RewriteRule ^2020/01/31/articulo\-ecohabitar\-invierno\-2019\-2020/$ /2020/01/31/articulo-ecohabitar-invierno-2019-2020-f7560cd1af.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=18$
RewriteRule ^2020/02/03/para\-informacion\-de\-los\-cursos\-https\-canyaviva\-org\-cursos/$ /2020/02/03/para-informacion-de-los-cursos-https-canyaviva-org-cursos-091b19505b.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=27$
RewriteRule ^2020/02/03/para\-informacion\-de\-los\-cursos\-https\-canyaviva\-org\-cursos/$ /2020/02/03/para-informacion-de-los-cursos-https-canyaviva-org-cursos-b031a5d78d.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=25$
RewriteRule ^2020/02/03/para\-informacion\-de\-los\-cursos\-https\-canyaviva\-org\-cursos/$ /2020/02/03/para-informacion-de-los-cursos-https-canyaviva-org-cursos-d8f6f5c613.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=24$
RewriteRule ^2020/02/03/para\-informacion\-de\-los\-cursos\-https\-canyaviva\-org\-cursos/$ /2020/02/03/para-informacion-de-los-cursos-https-canyaviva-org-cursos-6fe6f3e388.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=19$
RewriteRule ^2020/02/03/para\-informacion\-de\-los\-cursos\-https\-canyaviva\-org\-cursos/$ /2020/02/03/para-informacion-de-los-cursos-https-canyaviva-org-cursos-d38c2a1d2f.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=28$
RewriteRule ^2020/02/03/para\-informacion\-de\-los\-cursos\-https\-canyaviva\-org\-cursos/$ /2020/02/03/para-informacion-de-los-cursos-https-canyaviva-org-cursos-e919061219.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=17$
RewriteRule ^2020/02/03/para\-informacion\-de\-los\-cursos\-https\-canyaviva\-org\-cursos/$ /2020/02/03/para-informacion-de-los-cursos-https-canyaviva-org-cursos-c3bcacb286.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=22$
RewriteRule ^2020/02/03/para\-informacion\-de\-los\-cursos\-https\-canyaviva\-org\-cursos/$ /2020/02/03/para-informacion-de-los-cursos-https-canyaviva-org-cursos-7c56f3035c.html [L,QSD]

RewriteCond %{QUERY_STRING} ^replytocom=20$
RewriteRule ^2020/02/03/para\-informacion\-de\-los\-cursos\-https\-canyaviva\-org\-cursos/$ /2020/02/03/para-informacion-de-los-cursos-https-canyaviva-org-cursos-8d9b329e6f.html [L,QSD]

# Extension normalization (from manifest)
# Maps .php, .asp, .shtml URLs to .html files
RewriteRule ^servicios/$ /servicios.html [L]
RewriteRule ^2022/10/13/avances\-en\-cubiertas\-hidrofugas\-y\-semi\-flexibles\-2/$ /2022/10/13/avances-en-cubiertas-hidrofugas-y-semi-flexibles-2.html [L]
RewriteRule ^contacto/$ /contacto.html [L]
RewriteRule ^2020/01/31/articulo\-ecohabitar\-invierno\-2019\-2020/$ /2020/01/31/articulo-ecohabitar-invierno-2019-2020.html [L]
RewriteRule ^2019/04/08/bienvenidos\-a\-canyaviva/$ /2019/04/08/bienvenidos-a-canyaviva.html [L]
RewriteRule ^en/home/$ /en/home.html [L]
RewriteRule ^pt/home_pr/$ /pt/home_pr.html [L]
RewriteRule ^disenos/$ /disenos.html [L]
RewriteRule ^efimeras/$ /efimeras.html [L]
RewriteRule ^cursos/$ /cursos.html [L]
RewriteRule ^prensa/$ /prensa.html [L]
RewriteRule ^permanentes/$ /permanentes.html [L]
RewriteRule ^portafolio/$ /portafolio.html [L]
RewriteRule ^2020/02/03/para\-informacion\-de\-los\-cursos\-https\-canyaviva\-org\-cursos/$ /2020/02/03/para-informacion-de-los-cursos-https-canyaviva-org-cursos.html [L]
RewriteRule ^blog/$ /blog.html [L]
RewriteRule ^en/permanent_works/$ /en/permanent_works.html [L]
RewriteRule ^pf/castellon/$ /pf/castellon.html [L]
RewriteRule ^en/courses\-big/$ /en/courses-big.html [L]
RewriteRule ^pt/obras\-efemeras/$ /pt/obras-efemeras.html [L]
RewriteRule ^pf/expo\-zaragoza\-2008/$ /pf/expo-zaragoza-2008.html [L]
RewriteRule ^pf/alcantarilha\-2022/$ /pf/alcantarilha-2022.html [L]
RewriteRule ^pf/casa\-de\-laila/$ /pf/casa-de-laila.html [L]
RewriteRule ^pt/cursos_p/$ /pt/cursos_p.html [L]
RewriteRule ^pt/servicos/$ /pt/servicos.html [L]
RewriteRule ^pf/holsim\-award/$ /pf/holsim-award.html [L]
RewriteRule ^pf/nbda\-india\-2011/$ /pf/nbda-india-2011.html [L]
RewriteRule ^pf/el\-nido\-tavira\-2021/$ /pf/el-nido-tavira-2021.html [L]
RewriteRule ^pf/tavira\-2019/$ /pf/tavira-2019.html [L]
RewriteRule ^en/services/$ /en/services.html [L]
RewriteRule ^pf/disenos/$ /pf/disenos.html [L]
RewriteRule ^pf/primavera\-sound\-2017/$ /pf/primavera-sound-2017.html [L]
RewriteRule ^pt/desenhos/$ /pt/desenhos.html [L]
RewriteRule ^en/designs/$ /en/designs.html [L]
RewriteRule ^pf/boom/$ /pf/boom.html [L]
RewriteRule ^en/ephemeral\-works/$ /en/ephemeral-works.html [L]
RewriteRule ^construir\-estructuras\-pequenas\-para\-festivales\-con\-cana\-mediterranea/$ /construir-estructuras-pequenas-para-festivales-con-cana-mediterranea.html [L]
RewriteRule ^pt/obras\-permanentes/$ /pt/obras-permanentes.html [L]
RewriteRule ^pf/arboretum/$ /pf/arboretum.html [L]
RewriteRule ^pf/cane\-village/$ /pf/cane-village.html [L]
RewriteRule ^pf/lost\-theory\-2018/$ /pf/lost-theory-2018.html [L]
RewriteRule ^en/portfolio/$ /en/portfolio.html [L]
RewriteRule ^pf/burriana/$ /pf/burriana.html [L]
RewriteRule ^pf/freedom\-2009/$ /pf/freedom-2009.html [L]
RewriteRule ^en/contacto\-2/$ /en/contacto-2.html [L]
RewriteRule ^pt/contato/$ /pt/contato.html [L]
RewriteRule ^pf/green\-utopia/$ /pf/green-utopia.html [L]
RewriteRule ^pf/aambey\-valley/$ /pf/aambey-valley.html [L]
RewriteRule ^curso\-introdutorio\-de\-construcao\-com\-cana/$ /curso-introdutorio-de-construcao-com-cana.html [L]
RewriteRule ^pt/portfolio\-2/$ /pt/portfolio-2.html [L]
RewriteRule ^pf/cmb/$ /pf/cmb.html [L]
RewriteRule ^pf/boom\-2008/$ /pf/boom-2008.html [L]
RewriteRule ^pf/pixiland\-2013/$ /pf/pixiland-2013.html [L]
RewriteRule ^category/sin\-categoria/$ /category/sin-categoria.html [L]
RewriteRule ^pf/vic/$ /pf/vic.html [L]
RewriteRule ^pf/chile\-2019/$ /pf/chile-2019.html [L]

# Trailing slash → .html
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{DOCUMENT_ROOT}%1\.html -f
RewriteRule ^(.+)/$ /$1.html [L]

# Extensionless → .html
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/(.+?)$
RewriteCond %{DOCUMENT_ROOT}/%1\.html -f
RewriteRule ^(.+?)$ /$1.html [L]

