SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Mar 2006
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Chaning file extension from .html to .php

    Hi

    I have changed the site pages to .php from .html pages . Some of my pages have page rank. What mod rewrite rule will help me to retain the page rank .

    while chaning the files i have keep the older names of file

    older file new file

    a.html a.php
    b.html b.php
    c.html c.php

    etc

    Pls hlp

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,454
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    html to php

    Depending on how many pages have been changed from .html to .php, it may be better to have the PHP parser process all files with the .html extension as PHP files. ie.
    Code:
    AddType application/x-httpd-php .html
    Doing this will allow all .html files to still have the .html extension, but the PHP parser will parse the PHP code in them as though they had the .php extension. (BTW, this is good thing to do for .inc files if you've made the mistake of using the .inc extension too)
    IMHO this technique is better if you have lots of .html files with PHP in them as opposed to only a few as it does put more load on the parser. So you may not want it to parse files it doesn't need to.
    But having a lengthy amount of rewrites puts load on the server as the htaccess file is accessed for every HTTP request to the folder it's in, so that's something to consider too.
    If you do the rewrites, let the search bits know so they will eventually get "up to date" with lines like
    Code:
    Redirect permanent /index.html http://www.mittineague.com/index.php

  3. #3
    SitePoint Member
    Join Date
    Mar 2006
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have only 25 pages.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,454
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    redirects

    That's good that you've done this before the site's been developed too extensively and has tons of files. I suggest you do the "redirect" (not rewrite), and make any new pages .php in the future. With any luck the major search bots will catch on soon and you can then remove the redirects.

  5. #5
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    kash,

    Aw! I've got your solution in the tutorial article linked in my signature, code and all!

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •