Mam problem z routingiem Symfony 6 na produkcji. Metoda index działa, homepage się wyświetla, a nie działają pozostałe, images i videos, które są w tym samym kontrolerze, dostaję 404 Page Not Found. Lokalnie wszystko działa.
Zmieniłem w .env
APP_ENV=prod
do tego
yarn encore production
Prośba o pomoc, czy coś jeszcze muszę ważnego zrobić żeby mi routing zaczął działać produkcyjnie?
Mam Controller:
<?php namespace App\Controller; use Doctrine\Persistence\ManagerRegistry; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; class PageController extends AbstractController { #[Route('/', name: 'home')] public function index(ManagerRegistry $doctrine): Response { return $this->render('page/home.html.twig'); } #[Route('/images/{galleryId}', name: 'images')] public function images(ManagerRegistry $doctrine, $galleryId = null): Response { return $this->render('page/images.html.twig'); } #[Route('/videos/{galleryId}', name: 'videos')] public function videos(ManagerRegistry $doctrine, $galleryId = null): Response { return $this->render('page/videos.html.twig'); } }
routes.yaml
controllers: resource: ../src/Controller/ type: annotation kernel: resource: ../src/Kernel.php type: annotation