Server Side Include - php

938 views Asked by At

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.

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.

2

There are 2 answers

1
Dave Child On

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?

0
smilbandit On

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.