So I am trying to force javascript files to reload whenever we as developers update the files. In order to do this we are using the answer found here https://stackoverflow.com/a/7671705/805779 and we think this will work great however I am not sure how to do the mod rewrite. So here is the link I have
www.mysite.com/js/v1/myjs.js
I need to change it to
www.nysite.com/js/myjs.js
This is what I have so far but it is not working
<IfModule mod_rewrite>
RewriteEngine On
RewriteBase /
RewriteRule ^/js/(.*)$/(.*)$ js/$2 [L,NC,R]
</IfModule>
After some more testing I found my main issue was not adding .c to my IfModule, with that in mind the following is "partially" working
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/css/(.*)/(.*)$ /css/$2 [L,NC,R]
RewriteRule ^/js/(.*)/(.*)$ /js/$2 [L,NC,R]
</IfModule>
This works for my classic example
www.mysite.com/js/v1/myjs.js => www.nysite.com/js/myjs.js
However this does not work if more then one variable are involved. aka
www.mysite.com/js/v1/min/pages/myjs.js
My version number v1 will always be directly after the root folder so js/v1 or css/v1 and I want to remove the v1 and keep everything after it