How Do I Process PHP On HTML Pages Or Other Pages on Cloud Sites?


You can cause PHP to be processed on HTM and HTML pages by setting those extensions to be served by the PHP handler. You can enable PHP processing on .htm and .html in your .htaccess with the following directives:

AddHandler application/x-httpd-php php htm html
AddType text/html php

Following the above example, if you wanted to process PHP on files with the extension .test, you could do so using:

AddHandler application/x-httpd-php php test
AddType text/html php

You can find more information on AddHandler and AddType at Apache's website.

Note: We recommend using just the PHP extension for PHP pages.



Was this content helpful?




© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER