I'd like to accept other type of files that contains PHP code. For example, it would be nice to read an .aspx file by PHP as if it were .php.
Asked
Active
Viewed 425 times
3 Answers
7
Add this to your .htaccess file in Apache to make html parse as PHP:
AddType application/x-httpd-php .html
You can extrapolate what you need to do from there. :-)

Caladain
- 4,801
- 22
- 24
-
Let me know if that does the trick for you. If it doesn't, we can look at other solutions. – Caladain Aug 04 '10 at 21:17
-
And the documentation for `AddType` is at http://httpd.apache.org/docs/current/mod/mod_mime.html#addtype – VolkerK Aug 04 '10 at 21:50
0
Yes, this is done in your Apache configuration. You tell apache what kind of files you want it to send to the PHP engine. You can do this configuration the same way you do other apache configuration - in the main config file, per site, or in .htaccess files.

Scott Saunders
- 29,840
- 14
- 57
- 64