darrenc Posted September 18, 2015 Posted September 18, 2015 Standard website lives at www.foobar.com and by default the template files are served up from /site/templates/ Can processwire be set up to serve requests from dev.foobar.com by pulling template files from another directory? /devsite/templates or /site/devtemplate/ ?
Martijn Geerts Posted September 19, 2015 Posted September 19, 2015 Place the below in your /site/config.php // Honour goes to Raymond Geerts for the idea ! $config->templates = array( 'dev.foobar.com' => 'devtemplate', // domain => templates folder name ); if (isset($_SERVER['HTTP_HOST']) && isset($config->templates[$_SERVER['HTTP_HOST']], $config->templates)) { foreach ($config->templates as $host => $folder) { if ($_SERVER['HTTP_HOST'] === $host) { // set new paths $config->urls->templates = "/site/" . $folder . "/"; $config->paths->templates = dirname(__DIR__) . $config->urls->templates; break; } } } 7
darrenc Posted September 21, 2015 Author Posted September 21, 2015 Ohhhh very interesting. Thank you very much Martijn. Great answer.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now