简体   繁体   English

php包含在.htm文件中

[英]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');?> 我有几个静态.htm页面,所有这些页面都通过php调用通用的页眉和页脚: <?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 因此,我只是搬到了具有各种更高级别安全性的新服务器上,我们尝试过的所有措施都无济于事。.系统拒绝允许这些include调用,除非我将文件扩展名更改为.php

On the old server I was using in my .htaccess: 在我的.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... 回到suphp&seuexec,但没有nginx,那也没有帮助...

cPanel Server running: CENTOS 6.5 x86_64 vmware – WHM 11.40. 运行的cPanel Server: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?? 我已经遭受了流量损失的困扰,在20多年后将所有页面都更改为.php将会杀死该网站。 Thanks 谢谢

Have you tried these in your .htaccess? 您是否在.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. 我需要将它们放在1&1托管的服务器上,以将HTML文件解析为PHP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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