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.
blah.com/?utm_source=MailingList&utm_medium=email&utm_campaign=Blah+OCt+II
Of course if you hit that, Code Igniter displays an error about disallowed characters in the URL.
It seems that I can get around this by setting this in the config.php:
$config['uri_protocol'] = "AUTO";
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:
parse_str($_SERVER['QUERY_STRING'],$_GET);
I’m assuming that will then let the vars be parsed so the analytics JS code will pick up on it.
Does that all seem safe and logical?
Use the latest version of CodeIgniter, 2.1 has no problems with $_GET at all and 2.0.x should have been fine too.