Hi – this tip is for anyone using both wordpress and non-wordpress pages on the same site.
If you’d like to use a wordpress plugin on non-wp pages, or have anything in functions.php tell the non-wp pages what to do – e.g. display a different result from amazon depending on which folder they’re in (see If you're in this folder then display this) – then on all the non-wordpress pages:
(1) add this at the top before doctype:
<?php require '../wp-blog-header.php'; status_header(200); nocache_headers(); ?>
where “…/” is the path to root folder (public_html) where wp-blog-header.php is.
(2) add this in last line before you close
<?php wp_head(); ?><!--enables js+css to load for wp plugins-->
(3) add this before you close
<?php wp_footer(); ?><!--enables js+css to load for wp plugins-->
Some sites and even codex (http://codex.wordpress.org/Integrating_WordPress_with_Your_Website) will tell you to just add this at the top (in addition to wp_head & wp_footer):
<?php require '../wp-blog-header.php';?>
BUT if you do this (leave out the status_header and nocache lines) then WP will return a 404 error on the non-WP pages to bots like googlebot and xml-sitemaps. Essentially all your non-WP pages become invisible to googlebot. Only user browsers will still see them.
WP thinks that the non-WP page is a WP internal URL (because of wp-blog-header) and after it cannot find it internally, returns status code 404 although the page loads fine. So a human being sees it, but a bot sees the 404.
I learned the hard way!