Welcome to WebmasterWorld Guest from 22.214.171.124
I would like to make sure I send this so that my site/page is not spidered if it has not been updated. I would like to add a line to my .htaccess file to do this and am willing to change this this whenever I update my site. Will something like this work:
header set last-modified "Sun Jul 06 00:29:00 EDT 2009"
Does it matter where I put it in the .htaccess file (beginning/end)... any help/suggestions would be most appreciated!
So, you can use .htaccess, and make the changes manually, but that's not really the 'best' way to do it,
header set last-modified "Sun Jul 18 00:32:50 EDT 2004"
Is the line above the best way to do it via the .htaccess file (given that the .htaccess file is the way you want to do it)?
As for the "Header set" line, yes, that should work -- assuming that you enclose it in an appropriate <Files> or <FilesMatch> container.
Order of .htaccess directives does not matter, except among directives handled by the same Apache module. For example, if you have both mod_headers code and mod_rewrite code, then regardless of their sequence in the .htaccess file, either all mod_headers directives will be executed first, or all mod_rewrite directives will be executed first, and then all directives handled by the other module will be executed. So execution is per-module, and not in strict directive-by-directive order. Module execution order is determined by the server configuration, or by an internal priority mechanism, depending on your server version. As a result, it makes no difference where you put the "Header set" in your file, unless there is a conflict or 'overlap' with another mod_headers directive.
"Sun Jul 18 00:32:50 EDT 2004"
Last-Modified is defined as "Last-Modified" ":" HTTP-date (rfc2616 section 14.29)
HTTP-date is defined in rfc2616, section 3.3.1:
All HTTP date/time stamps MUST be represented in Greenwich Mean Time
(GMT), without exception. For the purposes of HTTP, GMT is exactly
equal to UTC (Coordinated Universal Time). This is indicated in the
first two formats by the inclusion of "GMT" as the three-letter
abbreviation for time zone, and MUST be assumed when reading the
asctime format. HTTP-date is case sensitive and MUST NOT include
additional LWS beyond that specifically included as SP in the
The ANSI C asctime() format you're using does not include a time zone in its date string as a HTTP-date.
As why I would use PHP to generate an HTML page but not to report its last-modified date... err I did not want to get into that.
The short explanation is that it is not .php code, its .asp code that has been moved to an apache server. I did not want to rewrite as .php specifically as .php because it would break all the links pointing to specific .asp pages. Further the .asp code does not have any asp script in it (not since it moved to the new apache server anyway), however it does use server side include functionality.
The simple answer was to have files with .asp extension processed as .php files. So wahhhlaaa... I have php pages with no php code/script in them... my situation.
[edited by: RedWine at 10:34 pm (utc) on July 6, 2009]