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',
);

1 Answer 1

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.

3
  • Your right, was not able to set it with that variable. Commented Sep 17, 2015 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. Commented Sep 17, 2015 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? Commented Sep 17, 2015 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.