Turning your .php pages into .htm for better spidering?

Discussion in 'PHP' started by DSR, Feb 11, 2006.

  1. #1
    Hi everyone!

    I did not realize that .htm and .php had such a difference in spidering with search engines until researching it on this forum. When i brose around now, i notice it and it's quite interesting...

    My question is, what does it take to run php code and makes your webpages look like they're .htm pages? Is it as simple as a piece of code? Or as complex as installing something onto the server that the site is hosted on? I'm quite confused... :confused: :)

    Thanks so much for any and all info! :)
     
    DSR, Feb 11, 2006 IP
  2. jrd1mra

    jrd1mra Peon

    Messages:
    243
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    my webhost has software installed so that I can run php code in any type of page. So I can run a script and call the page store1.html. It just takes a little more time to load ( not noticable on broadband or dsl) . I had to have my host allow this for me, but I have another site where this type of coding was allowed with no support request required.

    BTW IMHO the page extension has nothing to do with spidering. Its the URL whether it is dynamic or static. Its a myth that .php pages rank worse than .html.
     
    jrd1mra, Feb 11, 2006 IP
  3. mdvaldosta

    mdvaldosta Peon

    Messages:
    4,079
    Likes Received:
    362
    Best Answers:
    0
    Trophy Points:
    0
    #3
    All it takes is mod_rewrite in your .htaccess file. But, I think you've got a misconception. site.com/keyword.html doesn't have any more value or search engine favoritism over site.com/keyword.php

    The reason people mod_rewrite php is to get rid of url's like site.com/index.php?t=239352&id=324324 (that is addresses with multiple variables).
     
    mdvaldosta, Feb 11, 2006 IP
    Will.Spencer likes this.
  4. guru-seo

    guru-seo Peon

    Messages:
    2,509
    Likes Received:
    152
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That is very true. The file name extension makes no difference in ranking whatsoever.
     
    guru-seo, Feb 11, 2006 IP
  5. DSR

    DSR Member

    Messages:
    77
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    Well, i see quite a few php forums (bullein boards) changing the way their links are shown. They seem to be either straight directories or .htm/.html files instead of php. I have a lot of dynamic content from my database and would love to make it more easily spidered... Just not sure how big of a project it would really be...

    Could you elaborate on the .htaccess file and what i would need to do with it (just to get an idea)? :)
     
    DSR, Feb 12, 2006 IP
  6. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Try here.

    Its easier than it looks at first by the way!
     
    mad4, Feb 12, 2006 IP
  7. wwm

    wwm Peon

    Messages:
    308
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #7
    easy

    add into apache httpd.conf

    AddType application/x-httpd-php .php .phtml

    replacing the bit in bold with whatever file extension u want

    to be parsed my php

    once httpd.conf is updated restart apache

    voila
     
    wwm, Feb 12, 2006 IP
  8. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I use this in my .htaccess file:

    RewriteEngine on
    
    RewriteRule   ^(.*)\.html$              $1      [C,E=WasHTML:yes]
    
    #   rewrite to document.php if exists
    RewriteCond   %{REQUEST_FILENAME}.php -f
    RewriteRule   ^(.*)$ $1.php                   [S=1]
    
    #   else reverse the previous basename cutout
    RewriteCond   %{ENV:WasHTML}            ^yes$
    RewriteRule   ^(.*)$ $1.html
    Code (markup):
     
    clancey, Feb 13, 2006 IP
  9. dnabagger

    dnabagger Guest

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    That's great to know as I've been 'believing' the myth.

    Now, if I use an INCLUDE file as my navigation menu, will the links be followed by spiders? (no variables in urls, just straight xxxx.php)

    Thanks for your help!
     
    dnabagger, Feb 17, 2006 IP
  10. jrd1mra

    jrd1mra Peon

    Messages:
    243
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #10
    yes because the include is rendered by the server at the time of page request. The spider sees what you see when you "view source"
     
    jrd1mra, Feb 17, 2006 IP