i asked a question if i can execute html files as php files and i got those answers
AddType application/x-httpd-php5 .php .html
and another answer
AddHandler application/x-httpd-php .html .htm
and here is another one
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
and i got 1 problem
when i used to write any condition to add type it send me to download the page instead of run it
for example if i have a file index.html which have php code
after i create the .htaccess and write
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
then try to navigate the link it send me to download index.html instead of run it
AddType is used to assign a MIME type to a file suffix.
F.e. to override the MIME type of an PDF *sic
This will force the browser to load and show a PDF as plain text, because server is sending the text/plain MIMe type. But many applications handle files by content and not by suffix.
This is unnecessary, you don’t want to remove anything from the standard configuration.
This should do it, but it depends on your server configuration. You need the right “handler-name”.
Standard handler-name for most Apache servers with PHP installed is
but it could differ and it depends on your configuration. If you are using a shared or managed hosting without access to the Apache configuration file, you should ask your hoster.
I was using shared hosting with handler-names like
Otherwise have a look on your Apache configuration file. This page may be helpful to find the right section and to adapt.