title: Bookmarklet to add a parameter at end of each URL
body: <p>I'm trying to have a simple bookmarklet which adds a short parameter at end of any URL</p>
  
  <p>I use ?clearcache to empty an internal cache, so in order not to type it each time, I'm looking for a simple solution</p>
  
  <p>My site is</p>
  
  <pre><code>http://subdomain.mysite.net/ 
  </code></pre>
  
  <p>and with the bookmarklet I want to make the URL go to </p>
  
  <pre><code>http://subdomain.mysite.net/?clearcache
  </code></pre>
  
  <p>Same with deeper pages, as I would like it to go to </p>
  
  <pre><code>http://subdomain.mysite.net/some-page/?clearcache
  </code></pre>
  
  <p>I'm currently trying with </p>
  
  <pre><code>javascript:location=location.href.replace(/http:/g,"/?clearcache")
  </code></pre>
  
  <p>but it isn't working</p>
  
  <p>When I click on that bookmarklet, my URL becomes</p>
  
  <pre><code>http://subdomain.mysite.net/?clearcache//subdomain.mysite.net/
  </code></pre>
  
  <p>I feel I am close to it, but I just need a small tip from experts.
  I hope for a a reply.
  Thanks</p>