[TYPO3-50-general] Routing not working anymore

Thomas Fritz fritztho at gmail.com
Fri Mar 20 11:00:56 CET 2009


I did a completly new checkout. Now the startpage is showing up correctly.

But i still do have the routing error.

When I change this method in F3\FLOW3\Utility\Environment:

201         public function getRequestURI() {
202                 if (isset($this->SERVER['PATH_INFO'])) {
203                         $requestURIString = $this->getRequestProtocol()
. '://' . $this->getHTTPHost() . $this->SERVER['PATH_INFO'] .
(strlen($this->SERVER['QUERY_STRING']) ? '?' . $this->SERVER['QUERY_STRING']
: '');
204                 }
205                 else if ($this->SERVER['REQUEST_URI']) {
206                         $requestURIString = $this->getRequestProtocol().
'://' . $this->getHTTPHost() . $this->SERVER['REQUEST_URI'];
207                 }
208                 else {
209                         $requestURIString = $this->getRequestProtocol()
. '://' . $this->getHTTPHost() . '/';
210                 }
211
212                 $requestURI = new
\F3\FLOW3\Property\DataType\URI($requestURIString);
213                 return $requestURI;
214         }


and .htaccess to:

27         RewriteRule (.*) index.php

the routing works for me.


If you look for example at the Zend Framework Request Class:

    /**
     * Set the REQUEST_URI on which the instance operates
     *
     * If no request URI is passed, uses the value in $_SERVER['REQUEST_URI'],
     * $_SERVER['HTTP_X_REWRITE_URL'], or $_SERVER['ORIG_PATH_INFO'] +
$_SERVER['QUERY_STRING'].
     *
     * @param string $requestUri
     * @return Zend_Controller_Request_Http
     */
    public function setRequestUri($requestUri = null)
    {
        if ($requestUri === null) {
            if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // check this
first so IIS will catch
                $requestUri = $_SERVER['HTTP_X_REWRITE_URL'];
            } elseif (isset($_SERVER['REQUEST_URI'])) {
                $requestUri = $_SERVER['REQUEST_URI'];
                if (isset($_SERVER['HTTP_HOST']) &&
strstr($requestUri, $_SERVER['HTTP_HOST'])) {
                    $pathInfo    = parse_url($requestUri, PHP_URL_PATH);
                    $queryString = parse_url($requestUri, PHP_URL_QUERY);
                    $requestUri  = $pathInfo
                                 . ((empty($queryString)) ? '' : '?' .
$queryString);
                }
            } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0,
PHP as CGI
                $requestUri = $_SERVER['ORIG_PATH_INFO'];
                if (!empty($_SERVER['QUERY_STRING'])) {
                    $requestUri .= '?' . $_SERVER['QUERY_STRING'];
                }
            } else {
                return $this;
            }
        } elseif (!is_string($requestUri)) {
            return $this;
        } else {
            // Set GET items, if available
            if (false !== ($pos = strpos($requestUri, '?'))) {
                // Get key => value pairs and set $_GET
                $query = substr($requestUri, $pos + 1);
                parse_str($query, $vars);
                $this->setQuery($vars);
            }
        }

        $this->_requestUri = $requestUri;
        return $this;
    }


It seems that is a bit more complicated to get the right value on different
environments. You can see such kind of code in other projects too.


Best regards

Thomas


2009/3/20 Sebastian Kurfürst <sebastian at typo3.org>

> Hi Thomas,
>
> >
> > Uncaught FLOW3 Exception
> > *#1166550023: Object "F3\TYPO3CR\Storage\Search\Lucene" is not
> > registered.*(More
> > information <http://typo3.org/go/exception/1166550023>)
> This is because that class has been removed (F3\TYPO3CR\Storage\Search
> \Lucene). I suppose this error stems from the "Lucene" Package? This
> is obsolete by now and must be deleted.
>
> (It has been already removed from svn:externals - unfortunately such
> things are not removed automatically in checkouts).
>
> If this does not solve your problem, you'll need to post the full
> stack trace here
>
> Greets from Munich,
> Sebastian
> _______________________________________________
> TYPO3-project-5_0-general mailing list
> TYPO3-project-5_0-general at lists.netfielders.de
>
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-5_0-general
>


More information about the TYPO3-project-5_0-general mailing list