Forum Moderators: bakedjake

Message Too Old, No Replies

Tweaking Unix Apache to return headers

Last-Modified header

         

sanuk

4:17 pm on May 22, 2003 (gmt 0)

10+ Year Member



Hi,

Does someone know how to set a server, running unix Apache to return the Last-modify date from all the files/pages it serves.

I know this can be done with putting the adding the following meta header in the head section of a page:
<meta http-equiv="Last-Modified" content="Some_Date">

But a server can also be set to return this in the server headers returned, just don,t know where?

I had a look in the Apache Config-file, but I dont seem to find anything there.

Any server administrators online here?

Thanks and regards,
Sanuk

jdMorgan

4:31 pm on May 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



sanuk,

I use this in .htaccess. Setup for .httpd.conf should be similar. See Apache mod_headers [httpd.apache.org].


# Set up Cache Control headers
ExpiresActive On
# Default - Set http header to expire everything 1 week from last access, set must-revalidate
ExpiresDefault A604800
Header append Cache-Control: "must-revalidate"
# Apply a customized Cache-Control header to frequently-updated files
<FilesMatch "^(botlog¦test)\.html$">
ExpiresDefault A1
Header unset Cache-Control:
Header append Cache-Control: "no-cache, must-revalidate"
</FilesMatch>
<FilesMatch "^(calendar¦evnt\_sched¦4[0-9]{2}.?)\.html$">
ExpiresDefault A14400
</FilesMatch>
<FilesMatch "^index\.htm1">
ExpiresDefault A7200
</FilesMatch>
<FilesMatch "^robots\.txt$">
ExpiresDefault A7200
</FilesMatch>

HTH,
Jim

sanuk

5:58 pm on May 22, 2003 (gmt 0)

10+ Year Member



Hi,

Thanks for the answer.

I just checked which mods are installed but I dont have mod_headers installed so I dont think this would work
with .htaccess

Regards,
Sanuk

jdMorgan

6:24 pm on May 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



sanuk,

You might also want to take a look at the XBitHack directive in mod_include [httpd.apache.org].

Jim

sanuk

7:02 pm on May 22, 2003 (gmt 0)

10+ Year Member



Hi,

Thanks JP Morgan
I have been able to load mod_headers
it was in the config file but was commented out

But now I dont understand very well what to put in the .htaccess file, the explanation at Apache is not very clear about this, and not having English as my mother language also doesnt help with this.

The only thing I want is the server sending the Last-Modify header, nothing to do with cache-control or expire.

I have uncommentet the mod_header in config but am clueles of what to put in .htaccess.

Thanks a lot,
Regards,
Sanuk

sanuk

7:06 pm on May 22, 2003 (gmt 0)

10+ Year Member



Oooops sorry,
I mean thanks you JD Morgan NOT JP Morgan
a typo, Sorry
Sanuk

sanuk

10:16 pm on May 24, 2003 (gmt 0)

10+ Year Member



Hi,
I can still not get this Modified header working.
Searched every where for an example as what to put in htaccess.
Anyone?
Regards,
Sanuk