Welcome Guest, Not a member yet? Register   Sign In
Is there a way to accept single GET parameter?
#1

[eluser]Sam Dark[/eluser]
If there is only one GET parameter in URL its name will be considered as first URI segment. As I can see this is to make URL like http://example.com/?blog/post/test to work without mod_rewrite.

This is a god think but sometimes I need to accept first GET parameter. For example, some major link directories are adding ?from=dir to each link. So when going through http://example.com/?from=dir I'm getting 404 since I have nothing mapped to "from". I can map controller to "from". It will solve one issue but not all similar issues…

Is there a way to accept first parameter as it is?
#2

[eluser]Sam Dark[/eluser]
Exel from Russian community found this:

URI.php
Code:
// If the URL has a question mark then it's simplest to just
// build the URI string from the zero index of the $_GET array.
// This avoids having to deal with $_SERVER variables, which
// can be unreliable in some environments
if (is_array($_GET) AND count($_GET) == 1 AND trim(key($_GET), '/') != '')
{
    $this->uri_string = key($_GET);            
    return;
}

It prevents using GET with only one argument set.
#3

[eluser]Sam Dark[/eluser]
Yes, there is… by changing $config['uri_protocol'] to 'PATH_INFO'.




Theme © iAndrew 2016 - Forum software by © MyBB