简体   繁体   中英

php includes in .htm files

I've read everything here and tried almost all the suggestions, nothing is helping. I've got several static .htm pages that all call common headers & footers via a php include: <?php include('inc_logo_nav.htm');?>

So I just moved to a new server with all kinds of higher level security and nothing we have tried helps.. the system refuses to allow these include calls unless I change the file extension to .php

On the old server I was using in my .htaccess:

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

But on this new box I had to comment out those lines to get the pages to even come up. The tech guy is stumped too..

back to suphp & seuexec but no nginx and that didnt help either...

cPanel Server running: CENTOS 6.5 x86_64 vmware – WHM 11.40.

I'm already suffering from loss of traffic, changing all the pages to .php after 20+ years is going to kill the site... Can anyone help here?? Thanks

Have you tried these in your .htaccess?

AddHandler x-mapp-php5 .html .htm
AddHandler x-mapp-php6 .html .htm

I needed them on a server hosted by 1&1 to cause HTML files to be parsed as PHP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM