html to php

Discussion in 'Search Engine Optimization' started by palahubog, Oct 15, 2005.

  1. #1
    site is pure html and planning to migrate it to php. what is the best way to implement without losing any traffic and following google's rules?

    Should I use a 301 redirection? Do I have to delete the old html files?

    Nice forum! Very informatve. :)
     
    palahubog, Oct 15, 2005 IP
    bentong likes this.
  2. aaron_nimocks

    aaron_nimocks Im kind of a big deal Staff

    Messages:
    5,563
    Likes Received:
    627
    Best Answers:
    0
    Trophy Points:
    420
    #2
    Dont delete the html.

    The html is still going to be indexed in the search engines. So what you want to do is to 301 from the html to the php.

    Once you php pages are indexed then you can get rid of the html.
     
    aaron_nimocks, Oct 15, 2005 IP
  3. palahubog

    palahubog Peon

    Messages:
    5
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    will this not considered a duplicate content?

    are there any other way aside from doing a permanent redirection?
     
    palahubog, Oct 15, 2005 IP
  4. LGRComp

    LGRComp Well-Known Member

    Messages:
    516
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    195
    #4
    Leave the file extensions as .html and tell your server to process .html as php. This is talked about in this thread: http://forums.digitalpoint.com/showthread.php?p=186832

    If you are using apache you can do this by using a .htaccess file with the following:

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

    Most (but not all) control panels will allow you to do this through them.

    This way the search engines don't know the difference and no duplicate content.
     
    LGRComp, Oct 15, 2005 IP
  5. forumbulge

    forumbulge Guest

    Messages:
    483
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If i can bring up this old thread.
    I need to do the same thing, I have some html pages that need to be changed to .php so I can use PHP include files (i assume i cant include the files in .html?)

    Is the way LGRComp said the best way, or a 301 redirect?
     
    forumbulge, Dec 15, 2005 IP
  6. jbw

    jbw Peon

    Messages:
    343
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Neither way is 'best'. Just a different set of goals and tradeoffs. I have used both methods at various times. Another method I use sometimes is to combine them. Hard link the html to php and set up the server to serve both... then a few years later all the html is set to do the redirects.
     
    jbw, Dec 15, 2005 IP
  7. forumbulge

    forumbulge Guest

    Messages:
    483
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #7
    A few years? :cool:
    lol

    I dont even know how to do 301's, so Im just working out whats best before I jump in and stuff everything up...
     
    forumbulge, Dec 15, 2005 IP
  8. jbw

    jbw Peon

    Messages:
    343
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yep, usualy try and use cool urls. ( http://www.w3.org/Provider/Style/URI )

    It really takes awhile for urls to 'go away' , I still gets hits on things that have not been updated in almost a decade.
     
    jbw, Dec 16, 2005 IP
  9. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #9
    By doing what he was saying, you don't need to do a redirect. You just keep the site with the same extensions, but the html pages are treated exactly like php pages. As far as ranking goes, if you dont need to have a php extension, I would personally keep the extensions the way they are.

    Otherwise here is a php redirect script:
    
    <?PHP 
    header("HTTP/1.1 301 Moved Permanently"); 
    header ("Location: http://www.mysite.com/this-new-page.php"); 
    exit (); 
    ?>
    Code (markup):
    Also, if you are keeping the same page names, but just changing the extension type then you can use an htaccess script to redirect each page to the new page.
     
    jestep, Dec 16, 2005 IP