title: Dynamically change text based on URL input
body: <p>I am using the following code to dynamically change the text on my clients website (www.mydomain.com.au):</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;// &lt;![CDATA[
         var url = window.location.toString();
         var query_string = url.split("?");
                 if (query_string[1]) {
         var params = query_string[1].split("&amp;#038;");
         var param_item = params[0].split("=");
         param_item[param_item[0]] = unescape(param_item[1]);
         document.write(param_item["city"]);
                 } else {
                         document.write("24 Hour Glass Replacement");
                 }
  // ]]&amp;gt;&lt;/script&gt;
  </code></pre>
  
  <p>It works perfectly fine on the index page. e.g. <a href="http://www.mydomain.com.au/?city=test" rel="nofollow">www.mydomain.com.au/?city=test</a></p>
  
  <p>but when I am using the same code on other pages e.g. <a href="http://www.mydomain.com.au/Brisbane.html/?city=test" rel="nofollow">http://www.mydomain.com.au/Brisbane.html/?city=test</a> I get a 404 error. </p>
  
  <p>Appreciate any help</p>