Forum Moderators: open
<head>My site name: 05/07/2004 </head>
tomorrow should change to
<head>My site name: 05/08/2004 </head>
My pages are all html and I would like to keep them that way, but I may have to make the switch. I tried a javascript date but whenever I checked Google for a cached page the javascript updated, so it was an old page view but todays date. I hope I am making sense.
If you want the date to be a proper "stamp," you'd have to insert it on the server side using SSI or one of the dynamic technologies (ASP, PHP, CF, JSP, etc.).
For instance, if your host permits server-side includes, you could add
<html>
<head>
<!-- formats date as mm/dd/yyyy with leading zeros -->
<!--#config timefmt="%m/%d/%Y"-->
<!-- outputs the current date -->
<title>My Site Name: <!--#echo var="DATE_LOCAL" --></title>
</head>
[...]
My host does allow for SSI, but would that mean I would have to change my home page to .php etc...
I was wondering if there was a way to date stamp using .html pages. I know I have seen .html pages with a date stamp that are cached showing different dates, but I don't know how they are able to keep the .html extension.
I have seen .html pages with a date stamp that are cached showing different dates, but I don't know how they are able to keep the .html extension.
Actually, it's quite simple. You can write you own .htaccess file (if your sever permits you, of course!) and include a list of the extensions you wish to accept SSI. (Downside: this setting will slow down the serving of pages, since it tells the server to check every one of these pages for includes.)