1

I got this URL:

http://twitternieuws.com/class/function/ID?oauth_token=xxxxx&oauth_verifier=xxxxx

And I keep getting errors like "The page you requested was not found" or "The URI you submitted has disallowed characters". I tried changing the following options with different settings:

$config['permitted_uri_chars'];
$config['enable_query_strings'];
$config['uri_protocol'];

Is there anything I can do to make it work? I am using codeigniter 1.7.2

Shoe
  • 74,840
  • 36
  • 166
  • 272
iSenne
  • 2,656
  • 5
  • 26
  • 26
  • `permitted_uri_chars` is the way to go in this I think. Try putting parts of the url in little by little to see what it's complaining about – JohnP Apr 20 '11 at 12:07
  • It is the & and the =! When using the & or the = in the URL it doesnot work and gives me the error "The URI you submitted has disallowed characters". But if I set permitted_uri_chars then I get the error "The page you requested was not found" – iSenne Apr 20 '11 at 12:15
  • you can't use search-engine friendly segment based URLs and standard query string based URLs simultaneously – mahadeb Apr 20 '11 at 12:23
  • @mahadeb: Do you have a reference? Makes no sense to me what you're saying, in fact I'm doing it right now. – Wesley Murch Apr 20 '11 at 12:29
  • I use $_GET extensively for purposes that have nothing to do with SEO, on pages that aren't even indexed, Any argument wholly against the use of query strings on the basis of anything related to SEO is unfounded. – Wesley Murch Apr 20 '11 at 13:13

2 Answers2

2

Query strings in 1.7.2 are a joke, it uses ?c=controller&m=method to basically change your pretty urls to psuedo $_GET params. I really can't see why anyone would use it the way it's intended, it's very misleading and is not the same as normal query strings.

I highly suggest you check out the latest version of Codeigniter, where they do not unset the $_GET array (normal query strings are now usable). In one of the core files in the older versions it says CI does not use $_GET so we are going to unset() the global $_GET array. Well, what if I need to use $GET? I always thought it was crazy, and people have been screaming for true $_GET support for forever.

Seriously though, it's time to upgrade:

Latest: https://bitbucket.org/ellislab/codeigniter-reactor/

Stable: http://codeigniter.com/

Wesley Murch
  • 101,186
  • 37
  • 194
  • 228
  • I was afraid of that! I am testing to upgrade to 2.0.2! – iSenne Apr 20 '11 at 12:24
  • 1
    @iSenne: Make sure to read the change log and upgrade instructions, there are a few important (but easy) changes you'll need to make to your existing app. Most importantly, all core classes including Model and Controller are now prefixed with `CI_` – Wesley Murch Apr 20 '11 at 12:32
  • I was scared to upgrade, almost everything worked without problem though – David Houde Apr 20 '11 at 12:36
1

When upgrading to CodeIgniter 2 is not an option, you can recreate the $_GET variable like so (add this to every controller where you need the query string):

parse_str($_SERVER['QUERY_STRING'],$_GET);

And change this in your config.php file:

// $config['uri_protocol'] = "AUTO"; // change from this

$config['uri_protocol'] = "PATH_INFO"; // to this

Community
  • 1
  • 1
MM.
  • 1,966
  • 4
  • 20
  • 24