1

I need to parse html file as php. For this I just added below code in .htaccess file.

AddHandler application/x-httpd-php5-3 .php .html

But when I open my site downloading some files automatically. I don't know what is the issue. Somebody please help me. Thanks in advance.

Janaka R Rajapaksha
  • 3,585
  • 1
  • 25
  • 28
user3595293
  • 95
  • 1
  • 1
  • 6
  • Make sure .htaccess allow override is enables - AllowOverride All http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride And this will fix your problem: http://stackoverflow.com/questions/17024272/addtype-in-htaccess-causes-page-to-download – Janaka R Rajapaksha May 29 '14 at 09:09

1 Answers1

0

Maybe this helps you:

Using .htaccess to make all .html pages to run as .php files?

As @Marc-François said

Create a .htaccess file at the root of your website and add this line:

AddType application/x-httpd-php .html .htm

If your are running PHP as CGI (probably not the case), you should write instead:

AddHandler application/x-httpd-php .html .htm

And of course

AllowOverride All

Community
  • 1
  • 1