The PHP engine lets you create dynamic Web pages. PHP also reads HTML, so you can save an HTML file with a PHP extension and upload the new file to your server. After you upload the file to your server, you must indicate to the server that the new default Web page is the new PHP file. A default Web page is the page that opens when you navigate to a domain without the Web page specified.
1. Right-click the HTML file you want to convert. Click "Open With," then click "Notepad." After Notepad and the code loads, click "Save As" to open the dialog window.
2. Type "index.php" in the "File Name" text box, then click "All Files" in the data type drop-down box. Click "Save" to save the converted file.
3. Upload the file to your Web host. Each Web host has its own procedure to upload files, but typically, a Web host has a control panel and a custom interface to upload files.
4. Set the new index.php file as the default Web page. With an IIS Web host, you must use the host's custom interface to set the default Web page. With an Apache Web host, you can set the default Web page in the .htaccess file. Add the following file to the .htaccess file located in the root directory of your domain directory: DirectoryIndex index.php
- Thinkstock Images/Comstock/Getty Images