converting my site form html to php what to do with html pages

Discussion in 'HTML & Website Design' started by ellion, May 12, 2008.

  1. #1
    i have just converted my site from standard html to php pages. but i have not uploaded it to server yet, i was wondering if should i leave my html pages on the server as they are already indexed. i dont want people finding 404 on my site.
     
    ellion, May 12, 2008 IP
  2. ShaneC

    ShaneC Peon

    Messages:
    387
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The absolute best thing you can do is redirect the old pages to the new pages with a 301. If you keep both the html and php up there, then you are going to get penalized for duplicate content.
     
    ShaneC, May 12, 2008 IP
  3. ellion

    ellion Peon

    Messages:
    212
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    redirect pages with a 301. is that difficult?
     
    ellion, May 12, 2008 IP
  4. micksss

    micksss Notable Member

    Messages:
    4,427
    Likes Received:
    268
    Best Answers:
    1
    Trophy Points:
    285
    #4
    micksss, May 12, 2008 IP
  5. Rico760

    Rico760 Guest

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    cant you just change it to .php
     
    Rico760, May 12, 2008 IP
  6. ellion

    ellion Peon

    Messages:
    212
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i have changed all my pages to .php my whole site, this is the problem. when someone comes to my index.html or article.html page they wont find those pages because they are now index.php and article.php etc.
     
    ellion, May 13, 2008 IP
  7. ellion

    ellion Peon

    Messages:
    212
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    i dont have a .htaccess file:confused:. would i have to create a page for each old .html page and put a redirect script on each of them?
     
    ellion, May 13, 2008 IP
  8. nicangeli

    nicangeli Peon

    Messages:
    828
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Just create a .htaccess file, put in the root directory and then do as micksss says.
     
    nicangeli, May 13, 2008 IP
  9. ellion

    ellion Peon

    Messages:
    212
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    thanks for the advice so far! can i check this out with you all?

    i need to do the following?

    1 create a file and name it .htaccess
    2 edit the file so that each page has an equivalent line of code like so;
    redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
    3 upload the file to my server

    thats it! all my old pages will redirect to my new pages?

    my appologies for spelling out what may be obvious to some people but this is new to me and i dont want to get this wrong.
     
    ellion, May 13, 2008 IP
  10. ShaneC

    ShaneC Peon

    Messages:
    387
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #10
    ShaneC, May 13, 2008 IP
  11. jamesicus

    jamesicus Peon

    Messages:
    477
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Guide to .htaccess

    James
     
    jamesicus, May 13, 2008 IP
  12. ellion

    ellion Peon

    Messages:
    212
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    thanks all,
    i will give the tutorial a look over, and i think i understand now anyway
     
    ellion, May 13, 2008 IP
  13. ellion

    ellion Peon

    Messages:
    212
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    one other thing, where about on the server should i place my .htaccess file? in htdocs directory or outside
     
    ellion, May 14, 2008 IP
  14. ShaneC

    ShaneC Peon

    Messages:
    387
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Put it in the folder directory where your index for the site is located, and you should be good to go.
     
    ShaneC, May 14, 2008 IP
  15. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Another option would be to resave your PHP files as .html files (sounds crazy and stupid, I know), and then have Apache parse those HTML files as if they were PHP scripts.
     
    Dan Schulz, May 14, 2008 IP
  16. ellion

    ellion Peon

    Messages:
    212
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    how would i go about that, anything is worth a try.
     
    ellion, May 14, 2008 IP
  17. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
  18. ellion

    ellion Peon

    Messages:
    212
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    problem solved. thanks everyone who helped.
    here is how.

    convert doctype to transitional
    move <include php> out of page header
    set body width to 100%
    set left column width 25%
    set right column width 75%
    set header width 100%
     
    ellion, May 15, 2008 IP