how to route symfony urls and remove front controller from url

i ve tried some methods to route my url

require __DIR__.'/../vendor/autoload.php';
use SymfonyComponentRoutingRoute;
use SymfonyComponentRoutingRouteCollection;

$routes = new RouteCollection();

          new Route('/ip',
                    'IPAddress'   => "",
                    '_controller' => 'ControllerController::getIPResponse',
          new Route('/',
                    'IPAddress'   => "",
                    '_controller' => 'ControllerController::getIPResponse',


require __DIR__.'/vendor/autoload.php';

use SymfonyComponentHttpFoundationRequest;

$globals = (Request::createFromGlobals())->getPathInfo();

$request = Request::create($globals);

$routes    = include __DIR__ . '/src/app.php';

$container = include __DIR__ . '/src/container.php';

$response  = $container->get('framework')->handle($request);


when i try to access it works but when i try to use it doesnt work.

I also worked on my .conf file and it pointing to my front controller.
i.e. if i go to it works .

I also checked symfony routing doc but i think they didnt give the solution for this.

I havent used .htaccess file

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *