直接在.htaccess文件生成随机数 [英] Generating random numbers directly inside a .htaccess file
问题描述
目前我加入的随机数的到我的阿贾克斯的通过JavaScript或PHP的URL结束。我想知道如果我可以做同样的只是在我的的.htaccess
的文件,当我使用mod_rewrite重写它们。
Currently I'm adding a Random Number to the end of my Ajax URLs via Javascript or PHP. I'm wondering if I could do the same just inside of my .htaccess
file, when I'm rewriting them using mod_rewrite.
有没有什么办法可以作出的随机数或字符串的在的.htaccess
上任何─文件飞?
Is there any way to making a Random Number or String in a .htaccess
file on-the-fly?
编辑:我没有在我目前的code任何问题。我只是想知道如果我能生成的.htaccess文件或者不是一个随机数。我已经搜查了净,但找不到任何有用的呢。
I don't have any problem in my current code. I just want to know if I could generate a random number in the .htaccess file or not. I've already searched the 'net, but couldn't find anything helpful yet.
更新:好吧,我只是意识到阿贾克斯
请求缓存上的客户端的,但的.htaccess
作品上的服务器端的。所以,我的问题似乎完全没用了(至少在我自己的情况下),但感谢分享你的想法。
Update: Well, I just realized that Ajax
requests caches on the Client-side, but the .htaccess
works on the Server-side. So, my question seems totally useless now (at least in my own case), but thanks for sharing your ideas.
推荐答案
您可以尝试使用的 RewriteMap指令与 PRG
的MapType 。这使您可以调用外部程序来处理重写规则。这脚本可以做任何你想做...
You could try to use a RewriteMap with the prg
MapType. This would enable you to call an external program to process the RewriteRule. And that script could do whatever you want…
这篇关于直接在.htaccess文件生成随机数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!