Se agrega redireccion

parent fcce45cb
......@@ -2,3 +2,6 @@ nutrapharm:
resource: "@NutrapharmBundle/Resources/config/routing.yml"
prefix: /nutrapharm
redirect_inicio:
path: /
defaults: { _controller: AppBundle:Default:inicio }
\ No newline at end of file
......@@ -5,17 +5,16 @@ namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use AppBundle\Lib\Utiles;
class DefaultController extends Controller
{
/**
* @Route("/", name="homepage")
*/
public function indexAction(Request $request)
{
// replace this example code with whatever you need
return $this->render('default/index.html.twig', array(
'base_dir' => realpath($this->container->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
));
public function redirectHomeAction(Request $request){
$log = Utiles::setLog('NutraPharmBundle\Controller\DefaultController:indexAction', 'nutrapharm/index');
$ua = $request->headers->get('User-Agent');
$ip = $request->getClientIp();
$log->debug("Ingresando a redireccion de Nutrapharm... IP : $ip | UA : $ua....");
return $this->redirectToRoute('nutrapharm_homepage', [], 301);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment