How to map an extension for server side scripting - html to php

Sometimes we need including some functionality or server includes into static web files - html. But changing the extension can lose current search engine index and rank. That is why leaving the fiels with the same name is the better way. Easy html files can be mapped to be parsed as php file.

IIS 7.0:
1. Open IIS Management Console
2. Open Web-site node
3. Open Handler Mapping
4. Add the extension as request path (*.html)
5. Set the handler application/library: something like C:\Program Files\PHP\php5isapi.dll
6. Name it and click OK

Apache:
Just add the following row in the .htaccess file:
AddType application/x-httpd-php .html

1 comment:

  1. Or simply go to: https://php.iis.net/ to install php automatically with IIS Web Platform

    ReplyDelete