src/Zicht/Bundle/UrlBundle/Aliasing/Listener.php
public function rewriteRequest($event, $url)
    {
        // override the request's REQUEST_URI
        $event->getRequest()->initialize(
            $event->getRequest()->query->all(),
            $event->getRequest()->request->all(),
            $event->getRequest()->attributes->all(),
            $event->getRequest()->cookies->all(),
            $event->getRequest()->files->all(),
            [
                'ORIGINAL_REQUEST_URI' => $event->getRequest()->server->get('REQUEST_URI'),
                'REQUEST_URI' => $url
            ] + $event->getRequest()->server->all(),
            $event->getRequest()->getContent()
        );

        // route the request
        $subEvent = new Event\GetResponseEvent(
            $event->getKernel(),
            $event->getRequest(),
            $event->getRequestType()
        );
        $this->router->onKernelRequest($subEvent);
    }
public function rewriteRequest($event, $url)
    {
        // override the request's REQUEST_URI
        $event->getRequest()->initialize(
            $event->getRequest()->query->all(),
            $event->getRequest()->request->all(),
            $event->getRequest()->attributes->all(),
            $event->getRequest()->cookies->all(),
            $event->getRequest()->files->all(),
            [
                'ORIGINAL_REQUEST_URI' => $event->getRequest()->server->get('REQUEST_URI'),
                'REQUEST_URI' => $url
            ] + $event->getRequest()->server->all(),
            $event->getRequest()->getContent()
        );

        // route the request
        $subEvent = new Event\GetResponseEvent(
            $event->getKernel(),
            $event->getRequest(),
            $event->getRequestType()
        );
        $this->router->onKernelRequest($subEvent);
    }
public function rewriteRequest ( $ event , $ url ) { // override the request's REQUEST_URI $ event -> getRequest ( ) -> initialize ( $ event -> getRequest ( ) -> query -> all ( ) , $ event -> getRequest ( ) -> request -> all ( ) , $ event -> getRequest ( ) -> attributes -> all ( ) , $ event -> getRequest ( ) -> cookies -> all ( ) , $ event -> getRequest ( ) -> files -> all ( ) , [ 'ORIGINAL_REQUEST_URI' => $ event -> getRequest ( ) -> server -> get ( 'REQUEST_URI' ) , 'REQUEST_URI' => $ url ] + $ event -> getRequest ( ) -> server -> all ( ) , $ event -> getRequest ( ) -> getContent ( ) ) ; // route the request $ subEvent = new Event \ GetResponseEvent ( $ event -> getKernel ( ) , $ event -> getRequest ( ) , $ event -> getRequestType ( ) ) ; $ this -> router -> onKernelRequest ( $ subEvent ) ; }
Route the request to the specified URL.

@param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
@param string $url
@return void
Route the request to the specified URL .