I am trying to append a query string to the end of all .js
files, without actually making a code change. The purpose of this would be so static files get pulled from the server rather than the cache when they are changed so we don't have any stale static files.
So when my html says
<script type="text/javascript" src="file1.js">
I want it to actually pull
<script type="text/javascript" src="file1.js?v=1">
from the server. Is this possible?
So far I have:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.js$ /$1.js?v=1 [L,R]
But I don't think it's quite doing what I want it to...