When we install PHP with Apache, Apache will be able parse files with .php extension and execute the same.
But in Apache we can tweak configuration in that way so Apache start to parse other file extension as php file.
In this article we will see how we can instruct Apache to parse .html file as a php file.
This tweak we can perform at three places:
- At Apache Global Virtual Host
- At Individual Virtual Host
- .htaccess
In Apache if you want to add support for parsing .html as php file then you will need to place below at any of the above place.
[cc lang=”apache”]
AddType application/x-httpd-php .html
[/cc]
So this is not limited to just .html, you can add any extension you want in place of html.
Can we do the same with any file extension? So for example If I want my own file extension like .mm, will that work with this trick????
It should work, as i am running my own extensions .do & .inc on my server.
thanks for getting this clear…. :)