服务器端包含-PHP

服务器端包含-PHP

问题描述:

我正在更新当前为静态html(即index.html)的网站.我想将博客文章添加到页面中,并且仅了解SimplePie才能完成此任务.

I'm updating a site that is currently static html (i.e. index.html). I'd like to pull in blog posts into the page and only know of SimplePie to accomplish this.

问题1-如果我将网站从.html更新为.php,那么在搜索引擎重新编制索引的同时,搜索引擎优化是否会受到影响?

Question 1 - If I update the site from .html to .php is there a hit in SEO while the Search Engines re-index?

问题2-有没有一种方法可以使用Server Side Includes包含我的SimplePie结果的.php文件,还是另一种将博客文章直接拉入.html文件的方法?

Question 2 - Is there a way to use Server Side Includes to include a .php file of my SimplePie results, or another way to pull blog posts directly into a .html file?

我将不胜感激.

在您的httpd.conf文件中找到此行

Find this line in your httpd.conf file

AddType application/x-httpd-php .php .php3 .phtml

然后将.html添加到其中,有些系统还要求每个addtype在不同的行上,但我忘记了为什么.

Then add .html to it, also some systems require each addtype to be on a different line but I forget why.

AddType application/x-httpd-php .php .php3 .phtml .html

现在,您所有的.html文件都将被解析为php,并且您可以将标准php包含项用于results.php.

Now all your .html files will be parsed as php and you can use standard php includes for results.php.

您会遇到性能上的损失,但可能还不错.您可能要尝试一种客户端方法,除非您需要搜索引擎来利用simplepie掌握您的能力.

you'll take a performance hit but probably not to bad. you might want to try a client side approach unless you need search engines to pick up what your pulling in with simplepie.