Welcome Guest, Not a member yet? Register   Sign In
Router.php & "/"
#9

[eluser]Unknown[/eluser]
I don't know if this has been solve or not, but I'll go ahead and post my solution for the same problem I had with my server.

File: Router.php
Method: _set_routing()
Line: 94 (without modification)
Code:
//Look for this:

        // Fetch the complete URI string
        $this->uri->_fetch_uri_string();
    
        // Is there a URI string? If not, the default controller specified in the "routes" file will be shown.
        if ($this->uri->uri_string == '')
        {
          ...

For some reason $this->uri->uri_string yields "/" using var_dump().
So the solution was pretty simple in my case.
All that needs to be done is do a check and empty it out.
Code:
// Fetch the complete URI string
        $this->uri->_fetch_uri_string();

        /* ***************************************
         * Solution
         * ***************************************
         */
        if ($this->uri->uri_string === '/') {
            $this->uri->uri_string = '';
        }
        
        // Is there a URI string? If not, the default controller specified in the "routes" file will be shown.
        if ($this->uri->uri_string == '')
        {
                  ...

By looking at that code, I advice not be tempted to do something I was going to do ... like this:
Code:
if ($this->uri->uri_string == '' || $this->uri->uri_string == '/')

The "if" condition really wants to make sure that ...
Code:
$this->uri->uri_string = ''
... in order to load the default controller. So all I did is play safe and just clear the value.

I hope this helps the OP or anyone that may have this problem in the future.

Note that I'm with Mediatemple with Grid Server (gs)


Messages In This Thread
Router.php & "/" - by El Forum - 06-03-2008, 07:31 PM
Router.php & "/" - by El Forum - 06-04-2008, 09:16 AM
Router.php & "/" - by El Forum - 06-04-2008, 09:21 AM
Router.php & "/" - by El Forum - 06-04-2008, 09:51 AM
Router.php & "/" - by El Forum - 06-04-2008, 10:22 AM
Router.php & "/" - by El Forum - 06-04-2008, 10:28 AM
Router.php & "/" - by El Forum - 06-04-2008, 12:37 PM
Router.php & "/" - by El Forum - 06-04-2008, 04:14 PM
Router.php & "/" - by El Forum - 06-19-2008, 02:32 PM
Router.php & "/" - by El Forum - 06-20-2008, 03:12 AM
Router.php & "/" - by El Forum - 09-10-2008, 09:02 PM
Router.php & "/" - by El Forum - 07-11-2009, 03:55 PM
Router.php & "/" - by El Forum - 09-22-2009, 02:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB