Hi all i have silex application but i want the app to redirect to /blog of the site which directs me to the wordpress blog of the site but it keeps giving me 404 page.. i configured the app route to return a custom page of error 404
here is my code
<?php
require_once __DIR__.'/vendor/autoload.php';
$app = new SilexApplication();
$app->register(new SilexProviderTwigServiceProvider(), array(
'twig.path' => __DIR__.'/views',
));
$app->register(new SilexProviderUrlGeneratorServiceProvider());
$app->error(function (Exception $e,$code) use ($app){
switch($code){
case 404:
return $app['twig']->render('404.php.twig');
break;
default:
return $app['twig']->render('index.php.twig');
}
});
$app->get('/blog', function() use ($app) {
return $app->redirect('/blog');
});
$app->get('/', function() use ($app){
return $app['twig']->render('index.php.twig');
});
$app->get('/ContactUs', function() use ($app){
return $app['twig']->render('contactus.php.twig');
});
$app->get('/Solutions', function() use ($app){
return $app['twig']->render('solutions.php.twig');
});
$app->get('/OurProducts', function() use ($app){
return $app['twig']->render('ourproducts.php.twig');
});
$app->run();
?>