He estado tratando de obtener archivos .HTML para procesar archivos .PHP usando el archivo .htaccess, he utilizado lo siguiente, los cuales no funcionan y al intentar acceder a la página de prueba me da la opción de descargar archivo que no existe, alguna idea?
Intenté ambos;
AddType application/x-httpd-php .html .htm AddType application/x-httpd-php5 .html .htm
La Idea es permitir incluir en mis páginas web pero aún usar archivos .HTML.
A continuación hay más código de mi archivo .htaccess, no creo que esté jugando con el addType, pero lo publicaré.
## hide .html extension # To externally redirect /dir/foo.html to /dir/foo RewriteCond %{THE_REQUEST} ^[AZ]{3,}\s([^.]+)\.html [NC] RewriteRule ^ %1 [R,L,NC] ## To internally redirect /dir/foo to /dir/foo.html RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule ^ %{REQUEST_URI}.html [L]
1and1 decidí solo permitirme hacerlo con el siguiente código;
AddHandler x-mapp-php5 .html .htm
Necesitas agregar
AddHandler application/x-httpd-php .html .htm
Prueba esto:
AddHandler application/x-httpd-php .html .htm
o
AddHandler x-httpd-php .html .htm
o
SetHandler application/x-httpd-php
o
SetHandler application/x-httpd-php5
Editar: para servidores 1 y 1:
AddType x-mapp-php5 .html .htm
Uno de estos debería funcionar
Puedes probar el código a continuación también.
AddHandler x-httpd-php .html .htm
O
AddType application/x-httpd-php .html .htm