Multi Domains

Create multiple domains or url and bind this to arbitry theme or page/staticpage with extending routing rules use single CMS installation (support backend)

Back to Multi Domains Support

Linkonoid
Linkonoid

luc.petitjean61931 said:

Hi,

I just installed this free plugins which make the trick about the theme: https://bitbucket.org/keiosdevs/oc-multisite/src/master/

/*
        * Listen for CMS activeTheme event, change theme according to binds
        * If there's no match, let CMS set active theme
        */
       Event::listen(
           'cms.theme.getActiveTheme',
           function () use ($binds, $currentHostUrl) {
               foreach ($binds as $domain => $bind) {
                   if (preg_match('/'.$currentHostUrl.'/i', $domain)) {
                       Config::set('app.url', $domain);

                       return $bind['theme'];
                   }
               }
           }
       );

I hope you will ba able to help me.

Best regards.

Luc.

Please Disable it, as my plugin is not guaranteed to work with third-party plugins that partially duplicate functionality (this used "cms.theme.getActiveTheme" event). I will not make a secret out of this, since partly the idea of ​​this plugin (and not only it, as well as other disparate ideas from the Internet) formed the basis of the first (free) version of MDomainsLite (I removed it from the Marketplace, as I believe that free products do not develop because they are free of charge and always remain in "unfinished" form, since the author does not have time for this due to lack of motivation). But my plugin has long outgrown all existing alternatives in terms of functionality and another more advanced project is on the way, I will not get ahead of myself - this is a completely different plugin (partially with the functionality of this one), but of better (+ will support DNS servers and Web -server).

Last updated

Linkonoid
Linkonoid

luc.petitjean61931 said:

I checked modules/cms/classes/Router.php

  • On working local: file is not modified
  • On non working production: file is modified

All logic is based on $url of this file?

Thank you.

You can ignore this for now, as the plugin should work anyway (even with the original router). There are some problems when binding url pages, but with the domain as a whole it should work without problems.

Last updated

Linkonoid
Linkonoid

luc.petitjean61931 said:

Dear,

About the container i followed this tutorial page: https://blog.programster.org/deploy-october-cms-with-docker.

Could you please explain me what i need to check about the original router replacement?

Thank you.

Luc.

Something tells me that your domains are still not tied to one host (container). So the problem is not with my plugin, please solve the fundamental problem with hosting and domain binding.

  1. To begin with. Register 2 subdomains in DNS: sub1.domain.tld and sub2.domain.tld with the same server IP
  2. Install pure OctoberCMS with one theme
  3. If both domains (from mashine outside) see the CMS page (this means that both domains are looking at the same OctoberCMS installation), then you can proceed to installing and configuring MDomains !!!, if not, then:
    • a) If you are using Linux. Remove the Docker container (it looks like you don't quite understand how it all works), configure the usual bundle of Nginx + Mysql + PHP - it will take 10 minutes and without any problems with proxying.
    • b) If Windows. Obviously, you have already registered the hosts file with the required domains, since if you checked the work locally - then remove these records from there to work with support DNS. Remove the Docker container (it looks like you don't quite understand how it all works), configure the usual bundle of Nginx + Mysql + PHP - it will take 10 minutes and without any problems with proxying.

This is not ironic, since I do not spend my time on consulting about the plugin, but describing the basics of administration. What else can I add. MDomains has been working in a production environment for a long time (including on my test server - you can go there and see its work) and no problems have been noticed, if they appear (which happens very rarely), they are solved very quickly ... If something does not work, you need to look for the reason step by step, and not try to solve the problem by going over everything.

Last updated

Linkonoid
Linkonoid

Please write in essence if point 3) of the previous post is fulfilled. I'm always happy to help, but you provide data in snippets. There are no screenshots with settings to understand the situation, there are no logs, and there is practically no data, except for the beautiful name "Docker" which constantly appears in the posts above + write directly to e-mail: max@linkonoid.com

Last updated

Linkonoid
Linkonoid

luc.petitjean61931 said:

Dear,

About the container i followed this tutorial page: https://blog.programster.org/deploy-october-cms-with-docker.

Could you please explain me what i need to check about the original router replacement?

Thank you.

Luc.

Yes, more (regarding the tutorial). If you've gotten to Adding HTTPS / SSL, notice the line below (environment):

  • VIRTUAL_HOST = www.mydomain.com, mydomain.com

Last updated

21-25 of 25