与IIS和FastCGI .html文件解析PHP [英] Parse PHP in .html files with IIS and FastCGI

查看:431
本文介绍了与IIS和FastCGI .html文件解析PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大的网站有很多的.html文件,我想开始我的网页使用PHP,但我不希望改变链接的.php。我读的Apache服务器,你可以添加一个规则到.htaccess文件,将允许在普通的.html文件PHP解析。这可能在IIS?

I have a big site with lots of .html files, and I want to start using PHP in my pages, but I don't want to change the links to .php . I read on Apache servers you can add a rule to the .htaccess file that will allow PHP parsing in plain .html files. Is this possible in IIS?

推荐答案

当然可以。假设你正在使用IIS7,您只需更改处理程序映射请求路径,*。html的(来处理所有的HTML文件)。

Absolutely. Assuming you're using IIS7, you simply change the request path in "Handler Mappings" to *.html (to handle all html files).

请注意,你会得到一个很大的性能损失,但。这是更快,以提供静态内容,所以如果你有大量的html页面他们每一个人开始被解析由PHP。这将是preferable切换需要页面.PHP,但我明白,这将是棘手的修复所有的反向链接。

Note that you'll get a big performance hit though. It's much quicker to serve static content, so if you have lots of html pages every single one of them will start being parsed by PHP. It would be preferable to switch pages to .php as needed, but I understand that it would be tricky to fix all the backlinks.

有关设置它的更多信息<一个href="http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/#Configure_handler_mapping"相对=nofollow>这里。

More information about setting it up is available here.

这篇关于与IIS和FastCGI .html文件解析PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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