Humble Request: Please date your pages

In the times of pure and simple HTML you could look at a page’s metadata, e.g. with right click “View Page Info” and get (among other stuff) “Modified: 4 July 2008 14:40:03”. Often very useful information IMHO. The function still exists, but nowadays what you get usually is the very minute you called that page up – useless.

Zum Seitenende      Übersicht Sudeleien      Home & Impressum

That need not be so. There are several reasons for the “modified” entry no longer to work:

1) PHP

Add the following at the very top, before the <!Doctype:

<?php
$mtime = filemtime($_SERVER['SCRIPT_FILENAME']);
$last_modified = gmdate('D, d M Y H:i:s', $mtime) . ' GMT';
header("Last-Modified: $last_modified");
?>

2) SSI

Add this to your .htaccess:

SSILastModified on

3) CMSs and blogging software:

Not easy. You have to rely on what your system offers, if anything. But at least good templates contain a “posted” date somewhere in the layout, giving some indication of age.

If you use fancy layouts with footers or similar, it is also a good idea to include the file date in there.

4) When adding the footer through SSI the code may be:

<!--#config timefmt="%Y-%m-%d" -->
Last modified: <!--#echo var="LAST_MODIFIED" -->

Note that this will display the date of the main file, not that of the generic footer, which is exactly what you want here.

All those fancy new designer additions tend to make us lose what was best and most powerful about the web. Let us fight back and retain what’s ours by right.

Axel

Zum Anfang      Übersicht Sudeleien      Home & Impressum

Creative Commons Attribution-Share Alike 3.0 Unported License Viewable With Any Browser Valid HTML 4.01! Valid CSS!