1

I'm trying to route the homepage / to a specific template. In my routes.php file, i've tried these two without result:

return array(
    '/' => 'specific/_entry',
    '' => 'specific/_entry',
);
Brad Bell
  • 67,440
  • 6
  • 73
  • 143
Fred Carlsen
  • 2,997
  • 13
  • 23

1 Answers1

1

A site's home page is routed via a special route __home__. I don't believe you can set that in routes.php, but it's worth a shot. Generally, you specify a Single as the homepage, and can set the template there. It defaults to index.

Bryan Redeagle
  • 4,065
  • 13
  • 27
  • Your right, was not able to set it with that variable. – Fred Carlsen Sep 17 '15 at 13:50
  • Did you try routing through a plugin's defineSiteRoutes()? I've no idea if it makes a difference compared to routes.php. – Mats Mikkel Rummelhoff Sep 17 '15 at 15:14
  • 2
    I don't think it would. I believe Craft does some scrubbing before it adds the __home__ entry to the route. It's using Yii's router class and I don't believe __home__ to be a proper route. Why not use a Single or include the other template in the index.html template? – Bryan Redeagle Sep 17 '15 at 16:16