问题描述:

I need a simple htaccess rule to add a string to all css and js files.

everytime we update the software we need to make sure that people load the new js and css files and not use the cached ones...

I found some code where they strip out the version number.

 RewriteRule ^(.*)\.[0-9]{10}\.(css|js)$ $1.$2 [L] # Strip out the version number

but I would actually need the opposite.

at the moment a css file is like that in the page

 <link rel="stylesheet" href="css/forms.css" type="text/css">

I would like to accheive

 <link rel="stylesheet" href="css/forms.css?v=118" type="text/css">

same for JS

Your help is much appreciated

Thanks

相关阅读:
Top