GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 22-Oct-2003, 13:23
tenaki tenaki is offline
New Member
 
Join Date: Oct 2003
Location: Essex, UK
Posts: 11
tenaki is an unknown quantity at this point
Question

html to php


Hi all

When we set up our website we were very new to it all and just went with the flow and created all our pages in html.

Now however, certain new pages and things like the gallery, forum etc are in php.

I have tried to use php includes on html pages for things like random photo's or forum threads but it just aint working.

The only way I can see is to change my index.html to index.php,

So to the question/s

What will happen to the thousands of links, especially those on search engines? if I create a redirect will those links still find my pages?

Any ideas appreciated
  #2  
Old 22-Oct-2003, 15:13
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
you can get php to parse in .html if you change some details in your .htaccess. JDS has a tutorial, he'll post the tutorial for you.

R
  #3  
Old 22-Oct-2003, 17:39
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Hello Tenaki,

Important: everything I can suggest below depends on the web server you use; if it's Apache, then read on. If it's anything else, then I am unable to share any useful information for you to do this easily.

If Apache it is, you have 2 choices:
  • Go ahead and rename every file to their .php extensions and use Apache's mod-rewrite to take care of the Search Engine traffic in the short term (not recommended; simply too much work! + SEO suicide for the mid term).
  • Keep your existing .html files but make them process PHP just by adding a couple of lines in a file (highly recommended).
  #4  
Old 23-Oct-2003, 12:29
Matrix Matrix is offline
New Member
 
Join Date: Sep 2003
Posts: 19
Matrix is an unknown quantity at this point
Do you have access to the apache configs?
  #5  
Old 23-Oct-2003, 12:41
tenaki tenaki is offline
New Member
 
Join Date: Oct 2003
Location: Essex, UK
Posts: 11
tenaki is an unknown quantity at this point
Hi thanks for all the help so far

Yes I have access to apache and is it mime types.

There is an .htaccess that the host put on for me as per jds reply, I am checking to see if it's the same
Quote:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
which I think it is and I have set up a test page which I will send up in a mo.


Will let you know how it goes
  #6  
Old 23-Oct-2003, 15:19
tenaki tenaki is offline
New Member
 
Join Date: Oct 2003
Location: Essex, UK
Posts: 11
tenaki is an unknown quantity at this point
I have set up the test as you said but the page is totally blank

Quote:
<body>
<html>
<head></head>
<body>
<h1>
<?php echo "I LOVE PHP!"; ?>
</h1>
</body>body>


I looked in the public_html directory and the host has put this

Quote:
.htaccess.bak (file name)

AddType application/x-httpd-php .php .html


What do you think? I also think they added some mime types
  #7  
Old 24-Oct-2003, 04:19
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Oops, that's something I forget to mention... always make a backup copy of the original .htaccess file and that the .htaccess file is a hidden file.

Are you telling us that your new .htaccess file contains the following lines?:
Code:
.htaccess.bak (file name) AddType application/x-httpd-php .php .html
  #8  
Old 24-Oct-2003, 10:29
tenaki tenaki is offline
New Member
 
Join Date: Oct 2003
Location: Essex, UK
Posts: 11
tenaki is an unknown quantity at this point
No that has been in there some time, I think the Host put it in, I haven't overwitten by the way.

I just tried your little bit of code to see it worked

<body>
<html>
<head></head>
<body>
<h1>
<?php echo "I LOVE PHP!"; ?>
</h1>
</body>body>

And it don't.

The strange thing is I can use a php who's online script.

<script src=" /online/online.php"></script> works fine, but any includes are just ignored?
  #9  
Old 24-Oct-2003, 10:39
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
OK, if your host is helping you out with this; just tell him to backup your existing .htaccess file and create one with just these lines in it; nothing else, at least while you get this sorted:
Code:
RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html
  #10  
Old 24-Oct-2003, 14:40
tenaki tenaki is offline
New Member
 
Join Date: Oct 2003
Location: Essex, UK
Posts: 11
tenaki is an unknown quantity at this point
I think I have cracked it

I used the include in an iFrame ad it works!!


What do you think does that make sense?
 
 

Recent GIDBlogProblems with the Navy (Officers) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimizing your web server with Turck MMCache for PHP JdS Web Hosting Forum 2 07-Jan-2004 07:48
apache2 - php cgi fehler - schleife inna Apache Web Server Forum 8 27-Nov-2003 09:55
[Linux] Installing PHP --with-mcrypt JdS Web Hosting Forum 0 20-Aug-2003 08:40
PHP in HTML jrobbio Web Design Forum 4 24-Jul-2003 06:05
All the big PHP script collections that matter jrobbio MySQL / PHP Forum 5 06-Jun-2003 16:14

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 11:36.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.