From .html to .php

Discussion in 'Search Engine Optimization' started by MakeThatDollar, Jun 12, 2008.

  1. #1
    I have a site that is currently PR 4 and is ranking well on certain keywords.

    I have a question about it...

    If I change the index page from index.html to index.php, will it affect anything?

    I would say No but I just want to make sure.
     
    MakeThatDollar, Jun 12, 2008 IP
  2. ched

    ched Active Member

    Messages:
    185
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #2
    Put a 301 redirect in your htaccess file. That way any links will be redirected and your Page Rank will be transfered when Google does an update.

    The alternative is to add something like

    addhandler application/x-httpd-php .htm .html RewriteCond %{HTTP_REFERER} !^$

    to your htaccess file. This allows htm/html pages to be treated as a php page by the server. So a file even with an htm extension will perform as a php page.
    I thing you have to remove the "<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">" from the html.
     
    ched, Jun 12, 2008 IP
  3. dcristo

    dcristo Illustrious Member

    Messages:
    19,797
    Likes Received:
    1,201
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    5
    #3
    Tell the server to parse php code on html pages in .htaccess

    Link to the root directory of the homepage, not the page itself so filename changes are not an issue.
     
    dcristo, Jun 12, 2008 IP
  4. rruben

    rruben Peon

    Messages:
    115
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What is the added value of changing it to .php, nothing right? Why should you change it then? Don't do it, it's not relevant.

    On the contrary, on my wordpress blog I have links with .html behind it because visitors are used to that.
     
    rruben, Jun 12, 2008 IP
  5. MakeThatDollar

    MakeThatDollar Notable Member

    Messages:
    4,451
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    225
    #5
    I was wanting to include a php file from within the index.html file and it wouldn't work if I had it as index.html, but did when it was index.php.

    So how can I include a php file such as footer.php within the index.html file?

    I was using code such as <?php include "footer.php"; ?> but that didn't seem to work.
     
    MakeThatDollar, Jun 12, 2008 IP
  6. rruben

    rruben Peon

    Messages:
    115
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    the php file will only process html to the browser. And you can change your permalink structure to ad .html behind it. But it only make sense to do that if you use a content management system
     
    rruben, Jun 12, 2008 IP
  7. ched

    ched Active Member

    Messages:
    185
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #7
    If you add the handler to your htaccess file and remove the html as my post above you can keep the html file you have with the php include and the server will parse your php include file.
     
    ched, Jun 12, 2008 IP
  8. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #8
    Add this to your .htaccess:

    AddType application/x-httpd-php .html
     
    Camay123, Jun 12, 2008 IP
  9. hexi2

    hexi2 Guest

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    add it to the htaccess as people have said - should be fine
     
    hexi2, Jun 12, 2008 IP
  10. Hapexamendios

    Hapexamendios Peon

    Messages:
    49
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    As several people have already stated adding a php handling statement to your htaccess file is the way to go. However I have found that depending on your hosting solution the code to add to that file can vary. I have my sites hosted on 1and1 and the only way to parse a php script within an html file with them is to add the following to your .htaccess file:

    AddType x-mapp-php4 .html .htm
    AddType x-mapp-php5 .html .htm

    So basically if one doesn't work try the others until one works. Hope this helps, I had a fit with this when I was starting out.
     
    Hapexamendios, Jun 12, 2008 IP
  11. pneulameiro

    pneulameiro Peon

    Messages:
    440
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #11
    what version of apache are they using?
     
    pneulameiro, Jun 12, 2008 IP
  12. MakeThatDollar

    MakeThatDollar Notable Member

    Messages:
    4,451
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    225
    #12
    The operating system is " Redhat Linux Fedora 6 ". Does that help?
     
    MakeThatDollar, Jun 12, 2008 IP
  13. tsukara

    tsukara Banned

    Messages:
    1,030
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I agree on the post above. 301 redirect is the best solution on that.
     
    tsukara, Jun 12, 2008 IP
  14. Hapexamendios

    Hapexamendios Peon

    Messages:
    49
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I really have no idea. Does my having to do it in this manner indicate they're running an old version?
     
    Hapexamendios, Jun 13, 2008 IP
  15. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #15
    I have clients on one host that require this:

    AddHandler application/x-httpd-php .php .htm .html
     
    flawebworks, Jun 13, 2008 IP