I'm trying to get back into development, trying to set up Symfony on a shared hosting server with GoDaddy.
I am going through the tutorial with Symfony 4 (Here: http://symfony.com/doc/current/page_creation.html) but the URL.co.uk/lucky/number
is throwing a 404.
I set the exact same URL route to just / (instead of lucky/number) and it works fine.
This problem occurs with both routes.yaml
, and annotations.
<?php
namespace App\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
class ArticleController
{
/**
* @Route("/")
*/
public function homepage()
{
return new Response('OMG! My new first page already! ');
}
/**
* @Route("/news")
*/
public function news()
{
return new Response('This must be news?');
}
}
For example, the above works fine with /, but with /news I have a 404 error.
Could this be a problem with .htaccess
? I don't have one in my root.
It turns out that, with the above code, URL.co.uk/index.php/news
works just fine. obviously I don't want this, but I hope it helps get to the bottom of it...