问题
I have question:
RewriteCond %{HTTP_USER_AGENT} (safari|navigator) [NC]
RewriteCond IF SOMEONE ASK, IN LESS THAN 30 SECONDS (HALF MINUTE) FOR FILES IN FOLDERS (folder1|folder2|folder3)
RewriteRule ^((?!folder3/).*)$ /folder3/$1 [L,NC]
Perhaps more simplified:
RewriteCond IF SOMEONE ASK, IN LESS THAN 30 SECONDS (HALF MINUTE) FOR FILES IN FOLDERS (folder1|folder2|folder3)
RewriteRule ^((?!folder3/).*)$ /folder3/$1 [L,NC]
If someone ask (some browser) apache http server for files in folder1 and folder2 in less than 30 seconds but than ask for files in folder3 after that period of time ex. (in 45 seconds or 2 minutes) than rewriterule won't be executed. Files from all three folders must be reqested in less than 30 seconds in order to rewriterule work it's job.
回答1:
Answer to this question is unfortunately: "no, you can't do it in .htaccess"
There is no available variable in mod_rewrite
that lets you access the file modification/creation time and write conditions agains it.
See full list of mod_rewrite variable
Only option is to forward the request to a PHP controller and do this check inside PHP code.
来源:https://stackoverflow.com/questions/21984945/time-lock-for-mod-rewrite-in-htaccess-file