.html to .php and PageRank

Discussion in 'PHP' started by WebTechnocrat, Nov 16, 2008.

  1. #1
    I have a website in html and want to change its coding to .php. Won't there be any problems with maintaining website PR (index.html to index.php)?
    I'm aware that subpages will lose its PR.
     
    WebTechnocrat, Nov 16, 2008 IP
  2. logondotinfo

    logondotinfo Peon

    Messages:
    314
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    nope. Very simple to use .htaccess to still keep the index.html filename, yet have it execute php inside it (within <? and ?> tags)

    You just need this to .htaccess (or create a new .htaccess file if one doesnt exist):
    AddType application/x-httpd-php .html
    Code (markup):
    The added beauty of this is that you can leave your site live whilst you change it to php, doing one file at a time as you go along. :)
     
    logondotinfo, Nov 16, 2008 IP
    WebTechnocrat likes this.
  3. WebTechnocrat

    WebTechnocrat Guest

    Messages:
    44
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Should I make a .htaccess file in public_html directory with just this line, and change all .php files to .html?
     
    WebTechnocrat, Nov 16, 2008 IP
  4. Zeras

    Zeras Guest

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I know many php programmers who are using mod_rewrite's to make their sites use .html extensions specifically to help with search engines. Strange to see someone wanting to go the other way.

    Why are you wanting to do this? Is it just to support php in your pages? If so, you can modify the web server configurationt to treat .html files just like .php and parse them for php code.

    To answer your search engine question .. any time you change URL's, it will likely cause a temporary drop in traffic from search engines at some point. However, if your site receives enough traffic, it will correct itself.

    You can use mod_rewrite (via web config or .htaccess) to make the transition smoother as mentioned above. However, if you redirect all .php files to .html files, keep in mind that if you use any third party software like phpBB, vBulletin, etc. those programs use .php extensions and you will break them unless you store them on a different directory or subsite with different mod_rewrite rules.

    -Zeras
     
    Zeras, Nov 16, 2008 IP
  5. keym4k3r

    keym4k3r Peon

    Messages:
    250
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Did anyone try 301 redirections ?
    I mean leaving old file.html redirecting to new file.php.
    It is suppose to transfer PR on subpages.
     
    keym4k3r, Nov 16, 2008 IP
  6. logondotinfo

    logondotinfo Peon

    Messages:
    314
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #6
    yes, just pop the .htaccess in your public_html folder. This will then treat html pages as php...if no php code is in them, they are treated normally. This avoids any serps hit, will allow files to continue running without any detrimental effects and saves breaking any other software on the server.

    Simple is always best my friend.
     
    logondotinfo, Nov 16, 2008 IP