Se agrega redireccion

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