1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Changing part of a static site to PHP

Discussion in 'PHP' started by macdesign, Sep 28, 2004.

  1. #1
    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?
    SEMrush
     
    macdesign, Sep 28, 2004 IP
    SEMrush
  2. vlead

    vlead Peon

    Messages:
    215
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can use the 301 redirect. It will transfer the PR of the old .HTML pages to the new .PHP pages.
     
    vlead, Sep 28, 2004 IP
  3. macdesign

    macdesign Peon

    Messages:
    568
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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?
     
    macdesign, Sep 28, 2004 IP
  4. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #4
    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
     
    expat, Sep 29, 2004 IP
  5. vlead

    vlead Peon

    Messages:
    215
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    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
     
    vlead, Sep 29, 2004 IP
  6. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #6
    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
     
    expat, Sep 30, 2004 IP