Quesion about a website: how they generate all html pages
Moderator: General Moderators
-
vnwebworld
- Forum Newbie
- Posts: 9
- Joined: Thu Mar 09, 2006 8:07 am
Quesion about a website: how they generate all html pages
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!
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
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
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
-
vnwebworld
- Forum Newbie
- Posts: 9
- Joined: Thu Mar 09, 2006 8:07 am
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
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
Actually, it's more than a search terms in the URL increase your ranking. If your site has URLs like:Hockey wrote:That and some SEO experts claim Google, etc prioritize HTML files over PHP extensions...
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.
(Apache) httpd.conf
Code: Select all
AddType application/x-httpd-php .php .html .htm- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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
This isn't what you're referring to but I thought it was worth a mention
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
should be (no harsh/pound sign) at the start of the line:
then add
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
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.soCode: Select all
LoadModule rewrite_module modules/mod_rewrite.soCode: 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