수색…
404 응답 반환
 서버에서 자원을 찾을 수 없을 때 404 응답이 반환됩니다. Symfony에서는 NotFoundHttpException 예외를 throw하여이 상태를 생성 할 수 있습니다. 컨트롤러 내에서 추가 use 문을 use 하지 않으려면 Controller 클래스에서 제공하는 createNotFoundException() 사용하십시오. 
<?php
namespace Bundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class TestController extends Controller
{
    /**
     * @Route("/{id}", name="test")
     * Recommended to avoid template() as it has a lot of background processing.
     * Query database for 'test' record with 'id' using param converters.
     */
    public function testAction(Test $test)
    {
        if (!$test) {
            throw $this->createNotFoundException('Test record not found.');
        }
        return $this->render('::Test/test.html.twig', array('test' => $test));
    }
}
다중 경로
Symfony에서는 하나의 액션에 대해 여러 경로를 정의 할 수 있습니다. 이것은 동일하지만 매개 변수가 다른 함수가있는 경우 매우 유용 할 수 있습니다.
class TestController extends Controller
{
    /**
     * @Route("/test1/{id}", name="test")
     * @Route("/test2/{id}", name="test2")
     * Here you can define multiple routes with multiple names
     */
    public function testAction(Test $test)
    {
        if (!$test) {
            throw $this->createNotFoundException('Test record not found.');
        }
        return $this->render('::Test/test.html.twig', array('test' => $test));
    }
}
POST 요청 리디렉션
당신이 controllerAction에 있을 때 POST 요청 과 POST 요청을 가지고 있지만 POST 메서드와 요청 객체를 유지 하면서 다른 경로 로 리다이렉션 하려는 경우 다음을 사용할 수 있습니다.
return $this->redirectToRoute('route', array(
    'request' => $request,
), 307);
여기서 코드 307 은 요청 메소드를 보존합니다.
하위 도메인 기반 라우팅
 하위 도메인 기반 라우팅은 host 매개 변수를 사용하여 Symfony에서 처리 할 수 있습니다. 예를 들어 _locale 매개 변수를 하위 도메인 값으로 사용할 수 있습니다. 
가정
locale: en
domain: somedomain.com
 매개 변수는 parameters.yml config 파일에 정의되어 있습니다. route는 다음과 같습니다. 
/**
 * @Route(
 *      "/",
 *      name="homepage",
 *      host="{_locale}.{domain}",
 *      defaults={"_locale" = "%locale%", "domain" = "%domain%"},
 *      requirements={"_locale" = "%locale%|de|fr", "domain" = "%domain%"}
 * )
 * @Route(
 *      "/",
 *      name="homepage_default",
 *      defaults={"_locale" = "%locale%"}
 * )
 */
 이 시점에서 라우터는 http://de.somedomain.com 과 같은 URI를 처리 할 수 있습니다. 두 번째 @Route 주석은 기본 로케일 및 void 하위 도메인 인 http://somedomain.com 의 폴백으로 사용할 수 있습니다. 
Routing.yml을 사용하는 Symfony 경로
    profile_user_profile:
        path:    /profile/{id}
        defaults: { _controller: ProfileBundle:Profile:profile }
        requirements:
            id: \d+
        methods: [get, delete]
Annotations 대신 Routing.yml을 사용하기로 결정한 경우 모든 경로를 더 잘 볼 수 있으며 검색하기 쉽고 찾기 쉽습니다.
Routing.yml 과 주석 중 하나 를 선택하는 것은 당신에게 달려 있습니다. 당신은 다른 경로에 대해 둘 다 사용할 수 있지만 이것이 최선의 해결책은 아닙니다.
 주석 @Route() 해당하는 주석은 @Route() 과 같습니다. 
class ProfileController extends Controller
{
    /**
     * @Route("/profile/{id}", name="profile_user_profile", requirements={"id": "\d+"})
     * @Method("GET", "DELETE")
     */
    public function profileAction($id)
    {
        if (!$id) {
            throw $this->createNotFoundException('User not found.');
        }
        return $this->render('::Profile/profile.html.twig', array('id' => $id));
    }
}