I inherited a website with about 40 pages and the menus are static in the files as is the footer and header and are all html pages. I was thinking about using JS document.write in a javascript include to isolate the code and write it inline. After researching, it does not appear that SE's will see this and having SE's not find the menu links is not a good thing. Is there anyway to do this with .html pages? I am sure many of the pages have external links so i do not want to change them to php or asp. I am thinking bout writing a php script that will rewrite the pages and swap in the included content. Any suggestions would be welcome.
Most HTTP servers (IIS / Apache / Lighttpd etc) support Server Side Includes
<!--#include file="header.html" -->
// your content
<!--#include file="footer.html" -->
this would make your life easy ...
I think the best option is to do a dynamic load from a database of keywords like:
<meta NAME="DESCRIPTION" CONTENT="<?php require('file_that_loads_desc_for_each_individual_page.php'); ?>" />
<meta NAME="KEYWORDS" CONTENT="<?php require('file_that_loads_keywords_for_each_individual_page.php'); ?>" />
Its messy to have to modify an include
after include
. You say your site has 40 pages currently --> imagine having to modify 40 different php includes!
This makes it easier to modify all your pages and keeps your code clean by just dynamically generating the keywords from a database and only having to modify the actual content in a row to change it on a page.
In php you can add this to the .htaccess file and php will process the .html with the php engine as with .php files:
# Use PHP5 by default
AddHandler application/x-httpd-php5 .php .html
Got this from here I didn't test it now so cant guarantee the syntax but it dose work if you can change the .htaccess file on the server
I would re-write them in php then set up 301 redirects in your .htaccess file to redirect spiders and visitors to the new locations.