Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming > PHP
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Reply
 
Thread Tools Search this Thread Display Modes
Old 02-13-2008, 02:55 PM   #1
jperezmt
Junior Member
 
jperezmt's Avatar
 
Join Date: Apr 2007
Posts: 92
jperezmt is on a distinguished road
Default PHP Static Website

I'm new at programming and I just want to know if this is even possible.

I'd like to create a dynamic PHP website that produces Static Pages for Search Engines.

For example if I create an article page that uses MySQL to store the data. When ever I post a new article, I'd like it to create a new static html page. This would populate the site with static pages full of content for search engines. But I would still be able to edit / delete / comment etc through a backend tool that changes values in the Table and the changes are reflected on each static page.

Is it possible to do this? Hope it's not to confusing.
__________________
Build Your Web Presence
jperezmt is offline   Reply With Quote
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 02-14-2008, 12:36 AM   #2
hasan_889
Junior Guru
 
hasan_889's Avatar
 
Join Date: Aug 2006
Location: London
Posts: 995
hasan_889 will become famous soon enoughhasan_889 will become famous soon enough
Send a message via MSN to hasan_889 Send a message via Yahoo to hasan_889 Send a message via Skype™ to hasan_889
Default Re: PHP Static Website

I guess you meant to say ... your article data will come from database but output page will have html extension ... so it will look like it's a static page.

Yes - you can do that. if you use mod_rewrite module to rewrite your url ... you can manage to do that.

if you go to my website ... http://xpert.tvbusinesslounge.com ... you will find all pages have .html extension ... yet every thing is coming from database and i'm using .php to display the data.

here is nice tuitorial on rewrite url - http://www.alistapart.com/articles/urls/


if you are happy with my post ... click to award me reputation
hasan_889 is offline   Reply With Quote
Old 02-14-2008, 03:31 AM   #3
jumpenjuhosaphat
 Contributor 
 
jumpenjuhosaphat's Avatar
 
Join Date: Jun 2006
Location: Denver
Posts: 4,470
jumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud of
Default Re: PHP Static Website

You could do it the way that Hasan mentioned, or you could also produce an html file that is actually a static page, like any html page. It's actually quite simple. You will need to learn how to create a file, and how to write to that file using PHP. Really quite simple. You could also serve up PHP from a file with an extension of .html, or any extension for that matter.
__________________
Storage Sheds
Lost Forum
jumpenjuhosaphat is offline   Reply With Quote
Old 02-14-2008, 10:27 AM   #4
hasan_889
Junior Guru
 
hasan_889's Avatar
 
Join Date: Aug 2006
Location: London
Posts: 995
hasan_889 will become famous soon enoughhasan_889 will become famous soon enough
Send a message via MSN to hasan_889 Send a message via Yahoo to hasan_889 Send a message via Skype™ to hasan_889
Default Re: PHP Static Website

Quote:
Originally Posted by jumpenjuhosaphat View Post
You could also serve up PHP from a file with an extension of .html, or any extension for that matter.

are you saying that PHP code will be executed in a html extension file? Nope that's not possible - php code executes only with php extension file ... otherwise compiler cannot differentiate between php code and text.
hasan_889 is offline   Reply With Quote
Old 02-14-2008, 05:39 PM   #5
Bagi Zoltán
iWEBTOOL Moderator
 Contributor 
 
Bagi Zoltán's Avatar
 
Join Date: Aug 2006
Location: Hungary
Posts: 1,762
Bagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of lightBagi Zoltán is a glorious beacon of light
Default Re: PHP Static Website

Hasan, it is possible. You may use whatever you want as file extension until you let the apache webserver know that it sould be executed as php script. For instance if you want to use html file extension for your php scrip simply paste this code into the .htaccess file and will do the job.
Quote:
AddType application/x-httpd-php .php .html
Bagi Zoltán is offline   Reply With Quote
Old 02-19-2008, 08:28 AM   #6
imrankhan
Member
 
imrankhan's Avatar
 
Join Date: Aug 2006
Posts: 179
imrankhan will become famous soon enough
Default Re: PHP Static Website

I think use mod re write method that is easy. I have used the second method mean writing dynamic generated file into html using script. This only helps if you want to save database connections. I only did because there are 8000 unique vistiors on one of website and hosting company put some limit on database connection. As a result it shows erro messages when users were more than that limit.
__________________
Houses for Sale - Cars for Sale
imrankhan is offline   Reply With Quote
Old 02-20-2008, 08:51 PM   #7
jperezmt
Junior Member
 
jperezmt's Avatar
 
Join Date: Apr 2007
Posts: 92
jperezmt is on a distinguished road
Default Re: PHP Static Website

To All,

Will the search engines still be able to crawl the pages and index them as individual html pages if I use the mod_rewrite???
__________________
Build Your Web Presence
jperezmt is offline   Reply With Quote
Old 02-24-2008, 05:32 PM   #8
alemcherry
Senior Member
 
alemcherry's Avatar
 
Join Date: Mar 2007
Posts: 264
alemcherry will become famous soon enough
Default Re: PHP Static Website

Quote:
Originally Posted by jperezmt View Post
To All,

Will the search engines still be able to crawl the pages and index them as individual html pages if I use the mod_rewrite???

Your intention is to create static pages dynamically or have search engine friendly URLs?

Creating static pages from dynamic data (ie, generating html pages by a PHP script and writing it to the file system) is a lengthy process, and have some limitations(you can not greet avisitor by his name!) but is a great option to reduce server load. Some high end CMS (like reddot, worth millions) use the same technique. If you are serving millions of pages, such a technique will reduce your server load to just a small fraction - may be even less than 10% - of serving dynamic pages all the time.

mod_rewite and other .htacess/ apache config. techniques have an equal effect as far as SEO is concerned. if server load is not your criteria, you just need to do mod_rewrite.

But be warned that having static lookign URLs doesnt help much. It used to have a good effect, now a days serach engines can index dynamic pages as well. having all static pages doesnt guarantee an inclusion of all pages either.

Still many people prefer static looking pages. If you really want them, goahead
alemcherry is offline   Reply With Quote
Old 02-29-2008, 04:02 PM   #9
tjfalabama
Smurf
 
tjfalabama's Avatar
 
Join Date: Feb 2008
Posts: 1
tjfalabama is on a distinguished road
Default Re: PHP Static Website

For me the concern is server load on cheap hosting packages. I came across this site looking for this issue. If that is the case would caching the pages solve the issue. I recently started using WordPress and installed the caching plugin. Wouldn't this in effect bring the server load down significantly in a high load situation? Or is it still using much more resources than a static .html?
tjfalabama is offline   Reply With Quote
Old 03-25-2008, 01:39 PM   #10
mediacurse
Smurf
 
mediacurse's Avatar
 
Join Date: Dec 2006
Posts: 32
mediacurse will become famous soon enough
Default Re: PHP Static Website

mod_rewrite - not sure how useful it is but at least it makes things look pretty
mediacurse is offline   Reply With Quote
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Reply



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get 200+ static text links to your website for only $19.95!!!!! safnaf Marketing and Promotion 5 07-04-2007 07:52 PM
Pixel Ads PHP Website For Sale petershine Websites for Sale 0 03-21-2007 03:47 AM
Auction PHP Website For Sale petershine Websites for Sale 4 03-19-2007 02:24 AM
how to have a preview of my php website ? lite_ws Programming 5 10-17-2006 11:29 PM
my new dynamic php website: smartcoyote.com lite_ws Website Reviews 4 10-16-2006 10:07 PM


All times are GMT. The time now is 08:11 AM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.