Append querystring to url
2 posts
• Page 1 of 1
Append querystring to url
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
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
Re: Append querystring to url
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
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
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 24 guests