如何在mod_substitute apache中将字符串替换为当前时间戳?
我想以毫秒为单位用当前时间戳替换字符串,如如何在mod_substitute apache中将字符串替换为当前时间戳?,apache,.htaccess,http,httpserver,Apache,.htaccess,Http,Httpserver,我想以毫秒为单位用当前时间戳替换字符串,如 Substitute s|MyString|timestamp|ni 如何在我的.htaccess文件中使用mod_substitute.c来执行此操作?它是substitute和ssi include的组合,但它可以工作 AddOutputFilterByType SUBSTITUTE text/html Substitute 's/magi
Substitute s|MyString|timestamp|ni
如何在我的.htaccess文件中使用mod_substitute.c来执行此操作?它是substitute和ssi include的组合,但它可以工作
AddOutputFilterByType SUBSTITUTE text/html
Substitute 's/magical-string-here/<!--#config timefmt="%s" --><!--#echo var="DATE_LOCAL" -->/'
Options +Includes
AddType text/html .php # or what have you
AddOutputFilterByType INCLUDES text/html
AddOutputFilterByType替换文本/html
此处替换“s/神奇字符串//”
选项+包括
AddType text/html.php或者你有什么
AddOutputFilterByType包含文本/html
您真的需要毫秒吗?从新纪元开始只需要几秒钟就够了吗?我想我是个apache配置的新手。我需要一些逃生卡吗?因为如果我离开单引号,它什么也不做,如果我删除它,我就有一个服务器错误。仅此替换意味着它将替换为空字符串,而不是使用哪个apache版本?你有服务器端包含模块吗?确保您在运行Apache2.4且XAMP%s来自strftime(3)的AddType text/html.php
中添加了正确的文件类型。请尝试man strftime
查看可用格式列表。我的有%s,这是自纪元以来的秒数