Append querystring to url

Helicon Ape provides support for Apache .htacces and .htpasswd configuration files for Microsoft IIS.
User avatar
Posts: 34
Joined: 19 Feb 2013, 11:44

Append querystring to url

30 Sep 2015, 06:55

Hi there,
I am looking for an easy way to force a browsers cache to get the latest copy of a CSS file. What I was thinking is that rather than changing all the links to the CSS file on all the pages, I would get Ape to add a querystring to it before it sends it back to the browser. Would this work?

So the link would be "/includes/css/coreV2.css" which would then be changed to "/includes/css/coreV2.css?v=2"

Does this sound like it would work? If so, how would I do it?

Cheers,

Steve

User avatar
Posts: 34
Joined: 19 Feb 2013, 11:44

Re: Append querystring to url

30 Sep 2015, 08:23

I think I have found a solution:

RewriteCond %{QUERY_STRING} !^v=2.2$
RewriteRule ^includes/css/coreV2.css$ /includes/css/coreV2.css?v=2.2 [NC,L,R=301]

Each time I want to force it I change the value of v in both lines.

If there is a better way to do I would be interested in seeing it.

Cheers,

Steve

Return to Helicon Ape

Who is online

Users browsing this forum: No registered users and 25 guests