Myoch
Myoch

Reputation: 855

How to substitute a string to current timestamp in mod_substitute apache?

I would like to substitute a string by the current timestamp in milliseconds, like

   Substitute s|MyString|timestamp|ni

How can I do it using mod_substitute.c inside my .htaccess file ?

Upvotes: 0

Views: 620

Answers (1)

akond
akond

Reputation: 16060

It is a combination of substitute and ssi include, but it works

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                                                     

Upvotes: 1

Related Questions