title: Enabling querystrings in Code Igniter project
body: <p>I recently launched CodeIgniter based website for someone who wishes to be advertised and linked to by affiliates, in E-newsletters and the like. This type of linking generally attaches tracking code on the end, in the form of querystrings for analytics.</p>
  
  <p><code>blah.com/?utm_source=MailingList&amp;utm_medium=email&amp;utm_campaign=Blah+OCt+II</code></p>
  
  <p>Of course if you hit that, Code Igniter displays an error about disallowed characters in the URL.</p>
  
  <p>It seems that I can get around this by setting this in the config.php: </p>
  
  <p><code>$config['uri_protocol'] = "AUTO";</code></p>
  
  <p>This at least stops the error from being displayed. I only need it to be enabled for the homepage so I read online that you can set this in the controller of choice:</p>
  
  <p><code>parse_str($_SERVER['QUERY_STRING'],$_GET);</code></p>
  
  <p>I'm assuming that will then let the vars be parsed so the analytics JS code will pick up on it.</p>
  
  <p>Does that all seem safe and logical?</p>