Content Management System Outputting HTML

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I've created a basic Content management System that i use to maintain
my website.

However i'm having promblems with getting the site ranked on search
engines, presumably as it's all sourced from a MySQL Database.

What i'd like to do is to add an option in the Admin Interface that
would generate HTML files from the parsed PHP pages.

I understand how to save a full page into a file using ob_get_clean,
however this wouldn't solve the problem with the links which would
still be (for example) news.php?ItemID=2.

Is what i'm trying to accomplish feasable? and could anyone give me
some advice on the best way to solve the problem.



Re: Content Management System Outputting HTML

Ian N wrote:

Quoted text here. Click to load it

You are pretty close.  Instead of just using ob_get_clean to do one page,
you want to "walk" through your site, generating a static HTML for each
page, and converting all of links into static links.  The site will be
composed purely of static HTML, with the PHP pages only being used to
generate the HTML at build time, not at access time.

It is important that the file names and hyperlinks not change when you
rebuild the site, otherwise you will confuse the search engines.

Kenneth Downs
Secure Data Software, Inc.

Re: Content Management System Outputting HTML

I was hoping to maybe write some sort of function that would run
through it for me, so that a had a 'Convert' button which would do all
the hard work for me.

I've had a loot at the Apache solution and it does seem to be a good
way to go, i'm on a shared server so not sure if i'd be able to do this

Kenneth Downs wrote:
Quoted text here. Click to load it
Quoted text here. Click to load it

Re: Content Management System Outputting HTML

Quoted text here. Click to load it

Almost all shared servers have this enabled or will enable it on
request.  Primarily it is all controlled through a .htaccess file.

How I have done this in the past was wrote my CMS to do the following:
- deny anything with a 404 error not from mod_rewrite (no penalty for
double content)
- cache all database calls for 1hr or more depending on how much the
pages updates
- cache all the templates with the php source merged together (its a 3
file process on mine using a custom xml document).

Then it all runs together real quick.  Search engines have scanned
through every single page which is amazing when you have clients that
have 100 pages!


Re: Content Management System Outputting HTML

Quoted text here. Click to load it

How about using mod_rewrite to create search engine friendly URLs?  I've
done this on the advice of a search engine company that one of my
customers uses.  They have some spectacular results with some highly
competitive phrases so I guess they know what they're talking about!

Andy Jacobs
Intelligent Websites For Intelligent Business People

Site Timeline