Bad Credit Mortgages - Consolidation Loan - Ogłoszenia,praca - Myspace Proxy - Car Insurance

PDA

View Full Version : Changing part of a static site to PHP


macdesign
Sep 28th 2004, 5:59 pm
I have a part of one of my sites with staic pages generated by code, it was created by some programming that I got from someone else, and that program no longer works. So at this point some of those pages are out of date, and it's a pain to patch them manually.

The data for the pages is in an Access database, and I'm thinking it would be pretty easy to convert that to mySQL, and write some PHP code to generate the pages.

How will this affect the current page ranks? It seems that right now if the pages are called page1.html, page2.html, and become page1.php, then Google will lose all histoy of the existing page rank and links, and I will be starting over again. Also I have incoming links to the pages.

Do I have to create a bunch of .html pages that redirect to .php pages?

vlead
Sep 28th 2004, 9:56 pm
You can use the 301 redirect. It will transfer the PR of the old .HTML pages to the new .PHP pages.

macdesign
Sep 28th 2004, 10:16 pm
Just to clarify, I assume that means once I have the replacement PHP pages running, I should set 301 redirects on all the old .html pages. And [having never done this] it's something like changing the .htacess file to add:

redirect 301 /mysub/*.html /mysub/*.php

or do I have to put a line for each page?

expat
Sep 29th 2004, 2:03 am
Why would you change html to php? Just have the php parser run through all html pages. Yes it's in theory its a bit more server load but I've never had a problem and one doesen't need any 301 or needs to think about which pages have been made dynamic and which ones have to go that way yet.

Cheers
M@rtin

vlead
Sep 29th 2004, 7:33 pm
Just to clarify, I assume that means once I have the replacement PHP pages running, I should set 301 redirects on all the old .html pages. And [having never done this] it's something like changing the .htacess file to add:

redirect 301 /mysub/*.html /mysub/*.php

or do I have to put a line for each page?
I am not much of a PHP guy... my forte is .Net

This might be useful to you:
http://www.tamingthebeast.net/articles3/spiders-301-redirect.htm

expat
Sep 30th 2004, 12:44 am
depends if you're on ...nix hosting .htaccess

AddHandler application/x-httpd-php .html
AddHandler application/x-httpd-php .shtml

will force the php parser to scan throug html and shtml for example so you don't need to change or redirect anything and can do page by page and watch if it does anything to existing positioning.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain\.com
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=permanent]

takes care of www or non www by redirecting non www to www and sending a 301

just don't forget the slash before the dot on the rewrite cond
e.g. for a .co.uk it is \.co\.uk

RewriteBase /
RewriteRule ^.php$ .html [R=permanent]

does a permanent 301 redirect to .html to .php

If you need to do it in batches or need more manoverability look up use of regular expressions....

There are slight differences depending on actual nix hosting e.g. sun is slightly different.

I have no idea how this works in windows....

M