HTML file with PHP (.htaccess issue)

Status
Not open for further replies.

secretply2

New Member
Messages
3
Reaction score
0
Points
1
I'm having issues trying to view my website with php code in html files. I have added the following condition to the .htaccess file:
Code:
<FilesMatch "\.(html|htm)$">
ForceType application/x-httpd-php5
</FilesMatch>

When I try to view the website, it just downloads a file and nothing is shown. I also tried using the following:
Code:
AddType application/x-httpd-php5 .html .php
AddHandler application/x-httpd-php5 .html
AddDefaultCharset utf-8

The same thing happens as well. I've done this on a different website before from a different host so I'm not sure why it is not working here.
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
As far as I know, it's..
Code:
<FilesMatch "\.(html|htm)$">
ForceType application/x-httpd-lsphp5
</FilesMatch>
You should be really using a .php file rather than .html for the PHP "magic".
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
Removed. "Unspecified error" tricked me into resubmitting. Mobile networks these days..
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
I would just do a mod rewrite so that .php appears as .html or whatever.
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi secretply2,

Please could you try using application/x-httpd-lsphp instead (without the 5)? If you have any further problems with this, please tell me what your domain name is. :)

(@caftpx10 So close! :p)

Thank you,
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
Hi secretply2,

Please could you try using application/x-httpd-lsphp instead (without the 5)? If you have any further problems with this, please tell me what your domain name is. :)

(@caftpx10 So close! :p)

Thank you,
I had a slight feeling that something wasn't right about it.:D
 
Status
Not open for further replies.
Top