You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Timothy J. Luoma" <lu...@peak.org> on 2002/03/23 07:07:58 UTC

TrackModified not showing Last-Modified header in HTTP headers

I rent webspace on an Apache server:

I have the following in my /.htaccess

Options +Indexes
CheckSpelling On
IndexOptions +FancyIndexing +TrackModified

However, I do not get a last modified header:

# lynx -head -dump http://www.tntluoma.com/
HTTP/1.1 200 OK
Date: Sat, 23 Mar 2002 19:04:40 GMT
Server: Apache/1.3.19 (Unix) mod_perl/1.24_01 mod_throttle/2.11 PHP/4.0.6
Front Page/4.0.4.3 mod_ssl/2.8.3 OpenSSL/0.9.6b mod_jk
X-Powered-By: PHP/4.0.6
Connection: close
Content-Type: text/html

#

If I have read the instructions correctly, +TrackModified should give me
the headers that I want/need.

Can anyone explain why this isn't working?  Is it something the site
sysadmin needs to correct?

Thanks!

TjL



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: TrackModified not showing Last-Modified header in HTTP headers

Posted by "Timothy J. Luoma" <lu...@peak.org>.
On Sat, 23 Mar 2002, Joshua Slive wrote:

> One thing to consider: I don't know why you are looking for
> "last-modified", but if you just want to help out caching, then Expires
> might do fine.  Check the mod_expires doc for how to use that.

Thanks.  I am using some mirroring software that seems to like the
Last-Modified header to tell when a page needs updating/

> PHP: You can use PHP's capability to send HTTP headers to construct your
> own Last-Modified header as part of the PHP script.  My PHP coding skills
> are rusty, so I can't give you an example, but it should be as simple as
> checking the date on the file and using that to fill in a header.

It is quite a simple matter that I was able to find using "php http header
last modified" in google (namely
http://www.zend.com/manual/function.header.php which also explains Expires
headers in PHP)

> Joshua.

Thanks for your help... Now I have it working and now how to handle other
similar situations if/when they arise.

TjL

-- 
Site: www.tntluoma.com                       mailto:luomat@peak.org
Info: Apache/1.3.19 (Unix) with PHP/4.0.6


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: TrackModified not showing Last-Modified header in HTTP headers

Posted by Joshua Slive <jo...@slive.ca>.
On Sat, 23 Mar 2002, Timothy J. Luoma wrote:

> On Sat, 23 Mar 2002, Joshua Slive wrote:
>
> > TrackModified is from mod_autoindex and works only for automatic
> > directory listings, not for normal requests.  If you want a
> > last-modified header on ordinary (non-static) requests, that depends on
> > what you are using to generate you pages.
>
> Thank you Joshua, I had missed that key detail.
>
> Most of my pages are PHP generated, and 'index.php' is the first:
>
> DirectoryIndex  index.php index.shtml index.html index.htm
>
> I would also be interested to know how to get the info for PHP, HTML and
> SHTML pages.
>
> Thanks for any answers or pointers.  Trying to google for 'last modified'
> is not very productive!! :-)

One thing to consider: I don't know why you are looking for
"last-modified", but if you just want to help out caching, then Expires
might do fine.  Check the mod_expires doc for how to use that.

As far as how to get a Last-Modified header on responses...

PHP: You can use PHP's capability to send HTTP headers to construct your
own Last-Modified header as part of the PHP script.  My PHP coding skills
are rusty, so I can't give you an example, but it should be as simple as
checking the date on the file and using that to fill in a header.

SHTML: See the "XBitHack Full" directive in the mod_include docs.  That is
the only way I know of to get last-modified for SSI.

HTML: These should get last-modified automatically, provided they are
being sent out directly by apache, and not parsed for includes or other
dynamic content.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: TrackModified not showing Last-Modified header in HTTP headers

Posted by "Timothy J. Luoma" <lu...@peak.org>.
On Sat, 23 Mar 2002, Joshua Slive wrote:

> TrackModified is from mod_autoindex and works only for automatic
> directory listings, not for normal requests.  If you want a
> last-modified header on ordinary (non-static) requests, that depends on
> what you are using to generate you pages.

Thank you Joshua, I had missed that key detail.

Most of my pages are PHP generated, and 'index.php' is the first:

DirectoryIndex  index.php index.shtml index.html index.htm

I would also be interested to know how to get the info for PHP, HTML and
SHTML pages.

Thanks for any answers or pointers.  Trying to google for 'last modified'
is not very productive!! :-)

TjL

-- 
Site: www.tntluoma.com                       mailto:luomat@peak.org
Info: Apache/1.3.19 (Unix) with PHP/4.0.6


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: TrackModified not showing Last-Modified header in HTTP headers

Posted by Joshua Slive <jo...@slive.ca>.
Timothy J. Luoma wrote:

> If I have read the instructions correctly, +TrackModified should give me
> the headers that I want/need.

TrackModified is from mod_autoindex and works only for automatic 
directory listings, not for normal requests.  If you want a 
last-modified header on ordinary (non-static) requests, that depends on 
what you are using to generate you pages.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org