"using .htaccess to make all .html pages to run as .php files?" Code Answer


Create a .htaccess file at the root of your website and add this line:

[Apache2 @ Ubuntu/Debian: use this directive]

AddType application/x-httpd-php .html .htm

Or, from comment below:

AddType application/x-httpd-php5 .html .htm

If your are running PHP as CGI (probably not the case), you should write instead:

AddHandler application/x-httpd-php .html .htm 
By mistero on October 20 2022

Answers related to “using .htaccess to make all .html pages to run as .php files?”

Only authorized users can answer the search term. Please sign in first, or register a free account.