Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 11-01-2006, 06:21 PM   #1 (permalink)
Junior Member
 
Join Date: 10-31-06
Posts: 5
iTrader: 0 / 0%
Latest Blog:
None

tuckerkatt is liked by many
Question Best way to convert HTML based site to PHP?

I have an HTML site with approximately 1,000 pages that I am going to convert to PHP. Does that mean I will need to change every file from .html/.shtml extensions to .php? And also change every link to a .html/.shtml file within each file as well? If that's the case, what is the best (quickest) way to do this?

Thanks!
tuckerkatt is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-02-2006, 10:52 AM   #2 (permalink)
Senior Member
 
StupidScript's Avatar
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 663
iTrader: 0 / 0%
Latest Blog:
None

StupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really nice
If you're using an Apache server it's really quite simple, and doesn't require you to change any file extensions or links.

In your Apache httpd.conf file, look for the definition of the PHP MIME type and add the .html file extension to the space-separated list, i.e.:
Code:
AddType application/x-httpd-php .php .html
If there are additional definitions (i.e. for php4), add .html to those lines, as well.

Restart the web server to apply the change.

This will cause all files with the .html extension to be parsed by the PHP engine before delivery. You will now be able to include whatever PHP code that you like within those pages, and they will be handled just like the default .php files.

There are discussions about server overhead using this method, and I expect we may see some comments here about that, however on even high-load servers I have not seen any significant resource issues as a result of handling files in this manner. If your site is all .html instead of all .php, the PHP process is handling the same number of files that it normally would, anyway.
StupidScript is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-02-2006, 02:55 PM   #3 (permalink)
sim
Banned
 
Join Date: 01-23-04
Posts: 1,098
iTrader: 0 / 0%
Latest Blog:
None

sim is just really nicesim is just really nicesim is just really nicesim is just really nicesim is just really nicesim is just really nicesim is just really nicesim is just really nicesim is just really nicesim is just really nicesim is just really nice
I'll conver them all for you for 25$ ;-=]
sim is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-03-2006, 11:35 AM   #4 (permalink)
v7n Mentor
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,338
iTrader: 0 / 0%
Latest Blog:
Starting p90x today

Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Oh, StupidScript,
that's a good idea, I've never actually thought about that
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is online now  
Add Post to del.icio.us
Reply With Quote
Old 11-03-2006, 12:34 PM   #5 (permalink)
Senior Member
 
StupidScript's Avatar
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 663
iTrader: 0 / 0%
Latest Blog:
None

StupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really nice
Thx, Izzmo!

BTW, adding .shtml to the same definitions will also work, with those files being parsed both by the SSI engine and by PHP's engine. (I believe SSI will process first, then hand it off to PHP.)
StupidScript is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent dear my sites convert PHP to HTML so give important steps devat Coding Forum 4 06-27-2007 02:51 PM
custom script to convert my joomla site to vbulletin trichnosis Coding Forum 0 04-10-2007 10:25 AM
Software to convert html to pdf Buskerdoo Tech Support Forum 17 04-08-2007 11:58 PM
flash based on an html page zoran Web Design Lobby 1 01-12-2007 06:37 AM
Html convert to .gif tuzaj Graphic Design Forum 5 05-20-2005 02:00 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 05:09 PM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.