Php Silex链接到inapp wordpress网站
大家好,我有silex应用程序,但我希望该应用程序重定向到该网站的/blog,这将引导我到该网站的wordpress博客,但它一直给我404页。。我将应用程序路由配置为返回错误404的自定义页面 这是我的密码Php Silex链接到inapp wordpress网站,php,wordpress,routes,twig,silex,Php,Wordpress,Routes,Twig,Silex,大家好,我有silex应用程序,但我希望该应用程序重定向到该网站的/blog,这将引导我到该网站的wordpress博客,但它一直给我404页。。我将应用程序路由配置为返回错误404的自定义页面 这是我的密码 <?php require_once __DIR__.'/vendor/autoload.php'; $app = new Silex\Application(); $app->register(new Silex\Provider\TwigServiceProvid
<?php
require_once __DIR__.'/vendor/autoload.php';
$app = new Silex\Application();
$app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => __DIR__.'/views',
));
$app->register(new Silex\Provider\UrlGeneratorServiceProvider());
$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();
?>
您可能希望将Apache作为重写规则来执行此操作。。请问我该怎么做?