views:

40

answers:

3

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. Could it be possible?

Thank you very much in advance

+6  A: 

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
Assuming he is using Apache (usually good assumption).
Byron Whitlock
Thank you very much, that will do the trick!
Will
Apache is in the tags
Caladain
Let me know if that does the trick for you. If it doesn't, we can look at other solutions.
Caladain
And the documentation for `AddType` is at http://httpd.apache.org/docs/current/mod/mod_mime.html#addtype
VolkerK
A: 

Use this htaccess rule:

AddType application/x-httpd-php .php .aspx
Sarfraz
A: 

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