title: Remove question mark added to url using form 'get' method
body: <p>I am using a form and the 'get' method to offer users a return option to an unknown url that they came from within my site, as per the code below. I prefer this to just the browsers back button and it works without javascript.</p>
  
  <p>The problem I am having is that some browsers (chrome, safari, there may be others) are adding a question mark to the end of the url they are referred back to. I don't want this for seo reasons.</p>
  
  <p>My question is either:</p>
  
  <p>1) Can I prevent the question mark within my php code somehow; or</p>
  
  <p>2) Please could somebody show me how to redirect the url using htaccess, I potentially have urls that could end:-</p>
  
  <pre><code>.html?
  
  .htm?
  
  .php?
  
  /?
  </code></pre>
  
  <p>Thanks in advance.</p>
  
  <pre><code>&lt;?php
  if (isset ($_SERVER['HTTP_REFERER']) ) {
  $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
  echo '&lt;br /&gt;&lt;form action="' . $url . '" method="get"&gt;
  &lt;div id="submit"&gt;&lt;input type="submit"  value="Return to previous page" /&gt;&lt;/div&gt;
  &lt;/form&gt;';
  }
  ?&gt;
  </code></pre>