问题描述
我有一个问题:
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]
如果有人问(有些浏览器)的Apache HTTP服务器的文件夹1和FOLDER2文件在不到30秒,但比那一段时间除权后索要文件folder3。 (45秒或2分钟)比重写规则将不被执行。所有三个文件夹中的文件必须reqested在不到30秒,以重写规则工作,它的工作。
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.
推荐答案
这个问题的答案是不幸的:不,你不能这样做在.htaccess
Answer to this question is unfortunately: "no, you can't do it in .htaccess"
有一个在的mod_rewrite
没有可用的变量,它可以让你访问该文件的修改/创建时间和写agains它的条件。
There is no available variable in mod_rewrite
that lets you access the file modification/creation time and write conditions agains it.
选项只是将请求转发到PHP控制器和做此项检查里面的PHP code。
Only option is to forward the request to a PHP controller and do this check inside PHP code.
这篇关于时间锁的mod_rewrite的.htaccess文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!