Replace .php extension to .htm/.html extension
Submitted by ronard on Saturday, November 30, 2013 - 10:56.
Do you wish to execute your php script using .htm / .html file extension? Then this code will help you. By simply using .htacces file, your php script will execute using .htm and .html file extension. Please follow the steps below.
1. Create a file index.php, and copy the below script.
2. Create a file .htaccess, and copy the below script.
AddType application/x-httpd-php .html .htm
Note: It should be .htaccess, don't need to add other keyword.
3. Then run the script in your viewer which your index.html
Thank you for reading this tutorial, hope this will help you in your web development.
- <html>
- <head>
- <title>Change .php extension to .htm/.html</title>
- </head>
- <body>
- <?php echo "<h1>It works</h1>"; ?>
- </body>
- </html>
Comments
Add new comment
- Add new comment
- 18 views