header problems on server

Discussion in 'Site & Server Administration' started by kaptain, Feb 21, 2005.

  1. #1
    I have a dedicated server and have 6 different B block ips.

    When checking the headers of some of my sites, some do not list a last modified date and some do.

    1) can this cause problems with SE's for sites that i update daily?
    2) how can i fix this?
     
    kaptain, Feb 21, 2005 IP
  2. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can send a last modified header with php
    // always modified
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    PHP:
    (see the manual )

    But you probably want to see if there's something you can configure on your HTTP server to fix it.
     
    exam, Feb 21, 2005 IP
  3. Diamondbacks

    Diamondbacks Peon

    Messages:
    107
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Are most servers set up to send out a last modified date for PHP pages?
     
    Diamondbacks, Feb 21, 2005 IP
  4. kaptain

    kaptain Peon

    Messages:
    194
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Buy why would some show a modified date and others not?
     
    kaptain, Feb 21, 2005 IP
  5. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Last-Modified is usually set automatically for static content (e.g. static HTML files) because the server can use file's modification timestamp for this purpose. Dynamic content (e.g. PHP) is created using various bits and pieces that come from different sources and it cannot be timestamped automatically.

    J.D.
     
    J.D., Feb 21, 2005 IP
  6. kaptain

    kaptain Peon

    Messages:
    194
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    the sites are all static html...
     
    kaptain, Feb 21, 2005 IP
  7. Diamondbacks

    Diamondbacks Peon

    Messages:
    107
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    J.D., do you recommend adding the "Last Modified Header" to PHP pages for Search Engine purposes?
     
    Diamondbacks, Feb 21, 2005 IP
  8. kaptain

    kaptain Peon

    Messages:
    194
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    maybe i didn't explain myself or the problem .... these are three examples of three sites on the same server with different ips all static html.

    if i'm waisting my time on this let me know. thanks for any help.

     
    kaptain, Feb 21, 2005 IP
  9. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #9
    According to the spec " HTTP/1.1 servers SHOULD send Last-Modified whenever feasible," which suggests it's not mandatory, but advised. As for dynamic generated content "For entities with dynamically included parts, it may be the most recent of the set of last-modify times for its component parts."

    This doesn't really help with your problem though.
     
    nullbit, Feb 21, 2005 IP
  10. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I would compare these servers' config files. It's strange that you have two Content-Type headers in each response. Many of the listed headers aren't even HTTP headers. For example, HTTP has Transfer-Encoding header; instead I see Client-Transfer-Encoding. What is this output?

    As for ETag (entity tag), you can control it using the FileETag directive. Entity tags are used by caches to figure out if the cached response is still usable or not.

    J.D.
     
    J.D., Feb 21, 2005 IP
  11. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #11
    different header can be a result of .htaccess settings

    like parse php if this is switched on no last modified header will be send except if you put it into php itself.

    Check if all sites have the same setup starting with the .htaccess file
    (some shared hosts give you all the frontpage crap automatically in htaccess can have interesting results)

    None of my sites that uses php sends a modilied header. I rather take the hit on bandwidth and let the engines decide...

    Expat
     
    expat, Feb 21, 2005 IP
  12. kaptain

    kaptain Peon

    Messages:
    194
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #12
    :eek: well... i have added this to some of my .htaccess files

    AddType text/html .shtml
    AddHandler server-parsed .html .htm
    Options Indexes FollowSymLinks Includes

    i added this to the .htaccess files to parse .html as .shtml.....because i started these sites before i knew anything about .shtml.

    i also have a site that is setup as .shtml and it has the altered headers.

    so i guess this means any site that parses .shtml and php will have scewed headers. Someone posted a solution for php... what about .shtml??

    ... does it even matter... :confused:


     
    kaptain, Feb 21, 2005 IP
  13. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #13
    See if you have the execute bit set on these files and if you have XBitHack enabled.

    J.D.
     
    J.D., Feb 21, 2005 IP
  14. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Hi

    it depends on what you want and need

    options + includes
    AddType text/html .html
    AddHandler server-parsed .html

    will run both ssi and php for html

    Last modified

    As an explanation you can set and override most headers that are send in php

    The last modified header can make your page "old" but it saves on bandwidth as the engine will compare a LMH to it's db record and only get the page when different.

    PHP as standard supresses last modified and sends an x appl header (most of the times) thus search engines have to get the complete page to check for changes...

    IMHO it doesen't realy matter except if you are concerned about bandwidth and server performance...

    Expat

    PS one of you examples looks like a page that sends stuff before the <head> tag......
     
    expat, Feb 21, 2005 IP