Changing the Location of Your Craft Templates

Problem

You want to store your Craft templates somewhere other than the default /craft/templates directory.

Solution

By default, Craft will look for your templates in the /craft/templates directory.

To override this location, set the CRAFT_TEMPLATES_PATH constant in the index.php file in the web root of your project (/public/index.php, unless you’ve renamed the “public” folder).

For example:

<?php

$craftPath = '../craft';    // This should come first.
define('CRAFT_TEMPLATES_PATH', '/mytemplates');

// The rest of the file...

Discussion

Find out more in the official documentation.