View Full Version : HTML to PHP
tenaki
10-22-2003, 02:47 PM
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
ranjan
10-22-2003, 02:56 PM
http://www.desilva.biz/apache/rewrite.html
carbonize
10-22-2003, 03:25 PM
Why would he want to use modrewrite when all he wants is to redirect?
Make a .htaccess file and place it in the root folder of your site (the main folder where your index page is). The redirect code you need in the htaccess file is
Redirect permanent /oldpage.htm http://www.domain.com/archive/oldpage.htm
for a little more info goto http://www.carbonize.co.uk/Webdesign/htaccess.php
BUT when alls said and done the index page will be served to the visitors regardless of it's extension. So long as you only have a single index page the server will send that to the visitors browser.
tikanet
10-22-2003, 03:27 PM
The php initialization (configuration) file has to be told where include files can be found (what path to use to get to them). Check with your host and/or sys admin to get all that sorted out.
tenaki
10-22-2003, 03:30 PM
Thanks both
I have looked in my control panel and there is a "manage redirects" where you can set up temp and permanent redirects.
Would this do the same job? and would Google links etc still find the pages I don't want loads of 404 errors
cyanide
10-22-2003, 04:19 PM
Yes that would work.
You have to be careful though.
If you have alot of stuff in the .htaccess already,
then doing it through the control panel could give you error messages.
In that case, you should do it manually.
as suggested by carbonize
tenaki
10-28-2003, 03:29 PM
Thanks all, another plus for webPro
I went for the alteration to the .htaccess file in the end as I was a bit worried about errors with a redirect, and I am so paranoid about upsetting my search engine results lol.
thanks ranjan for the link and thanks to desilva.bz for working it through with me.
http://www.desilva.biz/apache/rewrite.html
carbonize
10-28-2003, 05:43 PM
Using a .htaccess redirect will not affect search engine placement. The redirect works by sending the people to the new page when they request the old page and search engine bots are coded to expect this sometimes.
le_gber
10-29-2003, 04:47 AM
tenaki, if all you want to do is changing page extensions but you keep the same page name and domain name you may want to try the following:
#forward spiders and visitors to the new php pages.
RedirectMatch permanent ^(.*)\.htm $1.php
Leo