Quesion about a website: how they generate all html pages

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
vnwebworld
Forum Newbie
Posts: 9
Joined: Thu Mar 09, 2006 8:07 am

Quesion about a website: how they generate all html pages

Post by vnwebworld »

Hi all,

While doing a project, I found a website with strange design:
http://products.kaonsoftwares.com/price-comparison/

All pages are in .htm files but it runs using PHP/MySQL. For example:
Softwares : http://products.kaonsoftwares.com/price ... twares.htm
Desktops : http://products.kaonsoftwares.com/price ... sktops.htm

Anybody knows how it works and what the advantages are? Is there any tutorial about this?

Thanks for viewing guys!
Last edited by vnwebworld on Thu Sep 07, 2006 2:07 am, edited 1 time in total.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Edit: It's possible they use PHP to generate HTML static pages...

Probably using Apache mod_rewrite

No real advantage, unless you subscribe to the fact that hackers won't figure out your using PHP so they remove you from their checklist of potential attacks...

That and some SEO experts claim Google, etc prioritize HTML files over PHP extensions...

Not sure about the latter though :P
vnwebworld
Forum Newbie
Posts: 9
Joined: Thu Mar 09, 2006 8:07 am

Post by vnwebworld »

I see.

Thanks for your reply Hockey. Yeah, my client also said that his SEO told him to do like that to make it friendly to Search Engine.

Anybody knows if it is true or not? And any other advantages?

Cheers!
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

I have no evidence but I can not imagine the main search engines prefer html over php. Why would they do that? Almost half the internet is php. Would be silly if they placed the php pages lower, considering there might be a lot of valuable content on them (hint hint).

More important can be if you use strings in your url's. Like product.php?yr=2005&p=167&id=198. Better would be to rewrite those to /2005/167/name-of-article
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Hockey wrote:That and some SEO experts claim Google, etc prioritize HTML files over PHP extensions...
Actually, it's more than a search terms in the URL increase your ranking. If your site has URLs like:

http://www.domain.com/product.php?id=1234

It's going to rank a lot lower than a site with URLs like:

http://www.domain.com/1234-Product-Title.html

Rewriting the URL to get keyword in is a very good idea. The theory behind the changing of the extension from PHP to HTML is that search engines believe static content is more likely to be relevant than dynamic content. I'm 100% sure that Google know how to rewrite URLs, so they'll know the extension is meaningless, but still.. it doesn't hurt to do it anyway just in case.
User avatar
Obadiah
Forum Regular
Posts: 580
Joined: Mon Jul 31, 2006 9:13 am
Location: Ashland, KY
Contact:

Post by Obadiah »

a really simple explanation is it could be include pages...kinda like what you could create if you had some iis frontpage extentions
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

(Apache) httpd.conf

Code: Select all

AddType application/x-httpd-php .php .html .htm
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Off-topic but you can actually have a PHP app which "caches" pages to .htm files. In this case you centralise functionality for creating hyperlinks to check your cache and use .htm if it's available. You then have the original web page (.php) generate a cached version if the cache is older than a set time.

This isn't what you're referring to but I thought it was worth a mention :)
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Post by panic! »

I've never been able to find mod rewrite written in a clear concise way, hope this helps:


make sure LoadModule rewrite_module modules/mod_rewrite.so is uncommented in your httpf.conf file so

Code: Select all

[b]#[/b]LoadModule rewrite_module modules/mod_rewrite.so
should be (no harsh/pound sign) at the start of the line:

Code: Select all

LoadModule rewrite_module modules/mod_rewrite.so
then add

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule /product/(.*)/(.*)/ /product.php?id=$1&id2=$2
</IfModule>

http://www.server.com/product/this_beco ... ecomes_$2/

if you enter

http://www.server.com/product/1234/ice_cream_machine/

the server looks up

http://www.server.com/product.php?id=12 ... am_machine

remember to make all your images, style sheets etc absoloute because the browser will look for them in http://www.server.com/product/1234/ice_cream_machine/ and that's not even a real directory.

Hope that helps.

-Robin
Post Reply