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

5
  • 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 Commented Apr 20, 2011 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" Commented Apr 20, 2011 at 12:15
  • you can't use search-engine friendly segment based URLs and standard query string based URLs simultaneously Commented Apr 20, 2011 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. Commented Apr 20, 2011 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. Commented Apr 20, 2011 at 13:13

2 Answers 2

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/

Sign up to request clarification or add additional context in comments.

3 Comments

I was afraid of that! I am testing to upgrade to 2.0.2!
@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_
I was scared to upgrade, almost everything worked without problem though
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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.