使用的.htaccess,使所有的.html页面运行作为PHP文件? [英] Using .htaccess to make all .html pages to run as .php files?

查看:1144
本文介绍了使用的.htaccess,使所有的.html页面运行作为PHP文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要运行我所有的HTML文件作为PHP文件,我没有足够的时间在我们presentation改变所有环节的明天。有什么办法来黑客这与我的Apache服务器?

I need to run all of my .html files as .php files and I don't have time to change all of the links before our presentation tomorrow. Is there any way to "hack" this with my Apache server?

推荐答案

在您的网站的根目录下创建一个.htaccess文件并添加以下行:

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

[@的Apache2的Ubuntu / Debian的:使用此指令]

[Apache2 @ Ubuntu/Debian: use this directive]

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

如果您正在运行PHP,CGI(可能并非如此),你应该写,而不是:

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

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

这篇关于使用的.htaccess,使所有的.html页面运行作为PHP文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆