If when using query strings and the page always gets redirected to index.php change $config['uri_protocol'] to:
$config['uri_protocol'] = "ORIG_PATH_INFO";
If when using query strings and the page always gets redirected to index.php change $config['uri_protocol'] to:
$config['uri_protocol'] = "ORIG_PATH_INFO";
rewriteCond %{REQUEST_URI} !/your_directory/ and anything below is subject to if that is true