2

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.

hakre
  • 193,403
  • 52
  • 435
  • 836
Will
  • 83
  • 3

3 Answers3

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
0

Use this htaccess rule:

AddType application/x-httpd-php .php .aspx
Sarfraz
  • 377,238
  • 77
  • 533
  • 578
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