9 votes
Accepted

Is it possible to route a subdomain to specific template group?

For this example we have two domains: http://www.example.com http://subdomain.example.com To use different templates for the subdomain, we can accomplished this with these steps: 1) Setup subdomain ...
user avatar
  • 13.3k
4 votes
Accepted

Does "preprod" count as a dev sounding sub-domain?

No, it doesn't match anything on the list: UPDATE After filing this request, the documentation has been improved to more clearly state that this is, in fact, an exhaustive list. I have update the ...
user avatar
  • 23.6k
4 votes
Accepted

htaccess www to non-www with subdomain

This question comes close but implementing with a subdomain doesn't work. It should work as long as you modify the rewrite rule to account for the subdomain: RewriteCond %{HTTP_HOST} !^foo\.bar\.com$...
user avatar
2 votes

What needs updating when moving site from subdomain to root?

Ok so on this site: 1) I forgot that I'd moved the templates folder outside the craft folder for easy access with this in the index.php define('CRAFT_PLUGINS_PATH',realpath(dirname(__FILE__)./../...
user avatar
  • 769
2 votes

Is it possible to route a subdomain to specific template group?

I know you asked for a way to do this without using a redirect, but if it's handled server-side via twig, it would be transparent and virtually instantaneous: {% if siteUrl == "http://subdomain.site....
user avatar
2 votes
Accepted

Root domain config overriding subdomain config

Craft looks for partial matches to apply config settings (both general.php and db.php which means you can do things like: '.dev' => array( .. '.com' => array( .. Craft applies these settings ...
user avatar
  • 3,833
2 votes

Is it possible to have one Craft install running

Sure it can. Craft 3 has multi-site support. And for using a subdomain, you don't even need that, just point that subdomain at the correct template URL (eg. forward blog.example.com to example.com/...
user avatar
  • 1,456
2 votes

Assigning the right license to the right subdomain

Technically 3 separate Craft installations would require 3 separate/unique Craft licenses even if they share the same root domain (site.com) and live off in subdomains off of that (a.site.com, b.site....
user avatar
  • 66.5k
1 vote

Persist session from frontend login form to craft dashboard on headless install

You can use defaultCookieDomain config setting to make all Craft cookies use your root domain: // config/general.php // mind the dot at the start 'defaultCookieDomain' => '.mydomain.com', This ...
user avatar
  • 6,775
1 vote

How can I have translations for my subdomain

I'd double-check your index.php files for all domains and make sure they're all using the correct handle in the define('CRAFT_SITE') code. Sometimes I copy/paste files between sites and forget to ...
user avatar
  • 1,075
1 vote
Accepted

Structuring site with multiple subsites

As of this comment, Craft 3 is still in beta but you may want to consider it as your challenge sounds like the new Sites functionality may be a good fit. Sites, allow you to manage multiple websites ...
user avatar
  • 13.3k
1 vote

How do I preserve user sessions across subdomains?

Figured this out, the appId setting was the culprit: https://craftcms.com/docs/config-settings#appId If using this setting, you probably don't want to set it to something dynamic (as I was, e.g. md5($...
user avatar
  • 3,061
1 vote

How do I set up same site to use two different subdomains?

Are these two sites exactly the same, and this is just an alias? If so, you don't need any configuration, just point the DNS to the right place, and it'll work. If not, can you provide more details ...
user avatar
1 vote
Accepted

Getting Page Not Found error for my custom subdomain setup

This is now fixed. The dynamic path to the new templates folder was wrong: define('CRAFT_TEMPLATES_PATH', realpath(dirname(__FILE__) . "/../templates_va").'/');
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible