Back to website
Login
Home
Login
Back to website
There was a problem loading the comments.
Can PHP code be put in files with the .html/htm file extension?
Support Portal
»
Knowledgebase
» Viewing Article
Print
02/01/2024 12:47 PM
PHP
Scripting
It is possible to run php code in .html files by adding the following to a .htaccess file:
AddHandler x-httpd-php81 .php
AddType x-httpd-php81 .html .htm
This will work for PHP 8.1, for other versions you can update the number after httpd-php to reflect the version you are using.
Share via
Did you find this article useful?
Related Articles
How can I change the file name extension of my index page?
Where do I put CGI or Perl scripts? Do they have to be in a specific directory?
I've put up my site but I still see the standard index page. What's up?
Categories
19
General
37
FAQ
11
Email Client
26
Reseller Management
36
Reseller
8
Udemy & Courses
9
Getting Started Guides
61
Email
8
Eco Web Hosting Control Panel
36
Your Account
4
Transfer/Renewal
7
Domain Control Panel
14
Hosting Control Panel
20
MySQL
21
Databases
12
Glossary
4
Registration
20
Domains
6
Admin
12
DNS
21
FTP
102
Web Hosting
11
SSH
8
SSL
10
Greenhost Configuration
13
Website Extras
16
Wordpress
41
Troubleshooting
14
Mailbox Admin
2
Windows
13
Web Builder
6
Managed WordPress
4
Python
23
PHP
9
HTML
7
CGI
2
ASP
37
Scripting
14
Webmail
25
Troubleshooting
3
MS-SQL
© Eco Web Hosting
English