Symfony: Getting basic routing to work
<p>this maybe due to my stupidity, but I could really use a hint here.</p>

<p>I have not done much with php so far, been mostly working with javascript, and now trying to get a grasp on Symfony. I'm working with vagrant and the great scotch-box, so I installed Symfony on this vm and created a new app. I tried creating a route that just returns "Hello world!", but i can't get it to work.</p>

<p>The route defined in the DefaultController is working. I created a new controller via the console command</p>

<pre><code>$ php bin/console generate:controller
</code></pre>

<p>and called it TestController. This is it:</p>

<pre><code>&lt;?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class TestController extends Controller
{
    /**
     * @Route("/test")
     */
    public function testAction()
    {
        return new Response( "Hello World!" );
    }

}
</code></pre>

<p>When navigating to [scotch-box address]/my_project/web I get the default route, but [scotch-box address]/my_project/web/test gives me a 404.</p>

<p>Maybe it has to do with the configuration of the vm, but this is not my expertise, so any nudge in the right direction will be appreciated. Thank you!</p>

<p><strong>Edit:</strong> After I managed to destroy my vm yesterday, I set up a clean scotch-box and installed symfony's demo-app, which is running just fine. I also have setup a clean Symfony project and changed only the DefaultController's route to "/home":</p>

<pre><code>&lt;?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller
{
    /**
     * @Route("/home", name="homepage")
     */
    public function indexAction(Request $request)
    {
        // replace this example code with whatever you need
        return $this-&gt;render('default/index.html.twig', [
           'base_dir' =&gt;     realpath($this-&gt;container-&gt;getParameter('kernel.root_dir').'/..'),
        ]);
    }
}
</code></pre>

<p>my routing.yml reads:</p>

<pre><code>app:
    resource: "@AppBundle/Controller/"
    type:     annotation
</code></pre>

<p>As I understand it, Symfony's welcome page should now be reachable via [scotch-box address]/my_project/web/home, but it isn't. Instead I can still reach it via [scotch-box address]/my_project/web, while /home throws a 404 page.</p>

<p>Maybe I'm wearing the idiot hat here, but I could not find anything in the documentation that would shed a light on this.</p>