5

To do this, copy index.php and .htaccess from a.com’s webroot into b.com’s, and make sure the $craftPath variable is correct. Then, around where $craftPath is getting defined, override $_GET['p'] to make Craft think that the URI actually started with subpath: $craftPath = '../craft'; $_GET['p'] = 'subpath/' . (isset($_GET['p']) ? $_GET['p'] : ''); // ... ...


5

I got the official answer from Brandon, here is the summary for anyone that might be in a similar situation: I can do what I need with only one pro license the main portal (acme.com) will run the "en" locale additional domains will use different locales (en-uk for UK, etc.) this will work even better in Craft 3.0 - there will be a support for "portal" and ...


4

Short answer, no. You'll want to make sure that your DB user has all of the necessary privileges. Just because you're not entering your data into the database doesn't mean that Craft isn't writing its own data into the database. There are several tables responsible for handling data which is automatically generated by Craft, and not managed directly by ...


4

It looks like this question was resolved via some extended sleuthing in the comments above: Can I disable the control panel? How can I run the Control Panel from a separate domain? Overall, it looks like the answer is yes, however some part of the solution lies in settings around the server environment and routing rules outside of Craft.


4

The short answer is yes — you need to use a domain names. You might also want to have a look at this multi-environment configuration method defined on the craft cookbook website that creates a global php variable called CRAFT_ENVIRONMENT in your main index.php. I generally use that in combination with Ben Parizek technique as described in this answer.


4

Using this technique to share the Craft app folder across different sites, results in each site having their own config folder. Since the license.key file that determines the licensing status of Craft lives in the config folder, setting up your sites like this will require a separate license for each site, as the domain2 site won't have access to the license....


4

You could create 2 site groups. One group for site A and one group for site B. Sitegroup A will contain contain 2 sites, the other one only one site. Your setup will look like this SiteGroup A - Site A - language NL - Site A - language Fr SiteGroup B - Site B - language Fr Let's imagine your Site A - language Fr is your primary site. So it ...


4

I pondered this for a while, and then did this, which will direct us to specific entries (not templates, I don't want to create more of those): {# We need a unique 404 for each site - just take us to the right slug relative to current URL #} {% switch currentSite.id %} {# siteA.com #} {% case 1 %} {% redirect '/my-404-slug' %} {# siteB.com #} {% ...


3

The approach you described is interesting and should actually work. Separate root folders would allow you to define the template folders individually (→ see Ben's answer on how to set this up), but it looks like that's not what you need and your subdomains are more part of one and the same site. Even with multiple root and template folders you could still ...


3

In order to get Live Preview to work across different subdomains on a single install, you'll need to setup a few extra things as outlined in this support article: https://craftcms.com/support/cross-domain-live-preview


3

The "Target Locale" setting under the Asset field's settings is referring to which locale do you want to select assets in. When it's set to "Same as source", then, for example, if you're viewing an entry in German, the Asset selector modal will only display Assets assigned to the German locale. And if you were viewing the entry in Dutch, it would only show ...


3

If the multiple sites are based on sub-domains (i.e. site1.site.com, site2.site.com), then a single craft/config/license.key file will cover all of the sites with no issues.


2

One way to do this, is use different environments for each domain and set a variable (for instance, an entry ID) for each environment. So, your config/general.php would look something like this: return array( '*' => array( // Every config setting that's the same for all domains (like devMode, omitScriptNameInUrls, etc. ), 'firstDomain.com'...


2

I've found an answer, but I don't know if it's going to cause me any problems or not. Looking at the debug output in the JS Console I noticed that although $_GET['p'] was set correctly to subpath/directory, $_SERVER['REQUEST_URI'] was only set to /directory and $_SERVER['QUERY_STRING'] was only set to p=directory. Maybe Craft or Yii uses the REQUEST_URI ...


2

You have one Craft install and one DB. Do everything described in that article, just replace the subfolder paths with the different domains: return array( // ... 'siteUrl' => array( 'en' => 'http://example.com/', 'es' => 'http://example.es/', ), ); Then all you have to do is to configure your webhost so that it routes ...


2

As long as your sites are hosted on the same server, you can easily share templates and plugins between them by defining the appropriate path constants in the index.php files for your sites: define('CRAFT_PLUGINS_PATH', '/absolute/path/to/your/plugins/folder'); define('CRAFT_TEMPLATES_PATH', '/absolute/path/to/your/templates/folder'); As for your resources ...


2

Brandon has stated (on the CraftCMS Slack channel, so, sadly, not easily linkable here) that custom locales will automatically translate to sites when upgrading from Craft 2 to Craft 3. At this point, Craft 3 is still in developer preview and not recommended for production sites, so I would recommend developing in Craft 2 and updating when a stable, final ...


2

With the current implementation of Live Preview in Craft, using Live Preview across different top-level domains isn't possible due to the cross-domain policy (as you found out) along with a few others. We've got a few ideas on how we might address this in the future, but it will definitely be after Craft 3 comes out.


2

In Craft, there is no such thing as a "section path" – there's only the "Entry Template" path (which tells Craft which template to load when the URL for an Entry in that particular section is requested) and the "URL format", which tells Craft how it should construct the URLs for the entries within that section. It's actually totally possible to have ...


2

As long as the control panel is only accessible from one domain, I'd say you're within the license requirements. example.com and example.fr are different domains, and really no less different than example.com and myawesomesite.com. You should probably get confirmation from the Craft guys to be 100% sure though, you can contact them on support@craftcms....


2

When you're creating a new local asset volume, you choose a file system path. I use both the site handle and the section handle in the path. For example: /assets/<SiteHandle>/images/<SectionHandle> Or, referencing your example (and using 'blog' as a section in your site): /assets/site1/images/blog I find that it's important to divide up the ...


2

It's not really Craft related, but assuming that you use .htaccess you could set up rewrite conditions to redirect the request: # Rewrite Engine RewriteEngine On # force HTTPS RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L] # force www RewriteCond %{HTTP_HOST} ^foo.com [NC] RewriteRule ^(.*)$ http://www.foo.com/$1 [L,R=301,NC]


1

Firstly the Craft install on your beta site, does it share the same database? Craft's multi-site setup is meant to use a single database. Secondly I'm not exactly sure what 'step 7' is asking me to do, could you please explain? Step 7: Configure Your Web Server and DNS 1. Configure your web server so the domain (e.g. beta.craftcms.com) points at the ...


1

I had the same question and here is a way to have assets in separate root folders using aliases with Site handles: How do I dynamically define Asset Volumes' Base URLs for different Sites?


1

If the two different domains are for the same "site", i.e. they have common things between them you can share, then yes - you can use one license for them. Craft's multi-site functionality isn't really designed for sites that have completely content that don't have anything in common in mind. Related documentation: https://docs.craftcms.com/v3/sites.html#...


1

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 and multiple languages in one Craft installation. You can find a longer discussion and some examples here: Managing Multiple Sites in Craft 3 – Sites and ...


1

You could make use of symbolic links. This works if your sites are: on the same system your system is running on a Linux server environment you have console access (ex. SSH) With symbolic links you can easily "mirroring" folders like css/js and templates, plugins, etc.. For the assets it's maybe better to use only one url and pointing to this over all ...


1

You could use a deployment solution like Beanstalk to update both your template folders with one push. I would think you could use the same assets folder fairly easily as long as the folder lives above the "craft" folder for both installations.


1

Yes it is possible. I have it done on a site which has some sub sites with different domain name. You set your multi-environment configs for each site/subsite. Then based on the domain the site is accessed by include different header/footer files. Then the main content/templates are mostly the same. Can share news between the sites so works well. I ...


1

Multi-environment-configs: don't think so. Maybe a solution is to use json template files on website1.com that you read (without craft) on website2.com?


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