Convert PHP Site to Static HTML

October 18, 2009 at 12:05:37
Specs: OEM Vista Home Premi, AMD Turion™ 64 X2
Hello, everyone.

I am taking over development duties on a small website that was done in PHP. I do not know PHP, and don't have the time to learn it before the launch deadline. I want to convert most of the site pages back to static HTML, and leave the existing Contact Form in PHP.

I don't want to just upload my HTML pages, without removing the PHP pages (which, I believe, are being parsed by mod_rewrite as HTML) because I don't want to risk the search engines thinking we've got duplicate content.

So, is it just a matter of going into the /www/html/lib/php directory and deleting all the PHP files that I don't want to be served dynamically? Or, is there something else I need to do?

See More: Convert PHP Site to Static HTML

Report •

October 18, 2009 at 22:54:13
Well, yes it sounds like you just want to delete the PHP files.

You know - you don't need to rename the HTML w/ a .HTML extension. An HTML-only file will work just the same w/ a .PHP extension - & this has the added advantage that you wouldn't need to update any of your links - so no broken pages / bookmarks / search engine links.

The mod_rewrite rule is probably just doing the same thing?? mod_rewrite is used to rewrite the URL request internally, so you could i.e., have your files with .html & have them automatically re-written when they came in with a .php extenion, i.e.:
RewriteEngine on
RewriteRule ^(.*).php$ $1.html [L]

Would make it so is served from test.html ... (but why not just replace the PHP files w/ the HTML versions, but leave the PHP extension ? )

You might also just look through the PHP files - a good programmer will put common files (header, footer, navigational stuff) in an include, so you don't need to update every file on the site when making a simple navigation text change. (Maybe take out all the dynamicness, but leave the <? include() ?> 's )

Report •

October 21, 2009 at 10:51:34
Thanks for the reply. I guess what I'm asking is this - can a website have some html pages be generated via PHP and others by regular means... i.e. hand-coded or via a program like Dreamweaver, for instance? If so, is it simply a matter of deleting the PHP-generated html pages? Or would one need to edit the PHP script, too, to remove references to those pages?

I'm not really concerned about maintaining pages names, links, etc. because the site hasn't been submitted to the search engines yet. So, in that sense, we're starting from scratch.

Report •

November 7, 2009 at 21:55:44
See,you have to understand first,what u want to do.
u hAve 2 options strictly
1.generate html/php files from another php can find the code in googling.
2.if ur pages dont have any dynamic content and only does siply static jobs,you can simply delete the php files and put html files instead of that.keep in mind,html will be only static and if u use any frame inside that fr dynamic things,u need to do that by php only(like contact us).
For more information you can visite the public forum of
Thr u will find lot of developers who daily work on such kind of things.

Report •

Related Solutions

Ask Question