简体   繁体   中英

Server Side Include - php

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

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

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?

I'd appreciate advice.

For question 1 - no, not necessarily. You can use apache's mod_rewrite to process the old HTML pages as php scripts, and you don't need to change URLs. For question 2, it depends how your simplepie results are loaded, but PHP can include another file fairly easily. Can you provide more detail about the file being included?

Find this line in your httpd.conf file

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

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

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

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.

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