verbb / patrol

Easy Maintenance Mode and Smart HTTPS Routing for Craft CMS
MIT License
29 stars 8 forks source link

Support for multiple sites #17

Closed chrisrowe closed 1 year ago

chrisrowe commented 5 years ago

Now Sites are first class citizens (rather than locales), it'd be great to add support for them. Perhaps with something along the lines of

<?php

return [
    '*' => [
    ],
    'dev' => [
    ],
    'staging' => [
    ],
    'production' => [
      'primaryDomain' => [
        'fooSiteHandle' => "http://www.foo.com/",
        'barSiteHandle' => "http://www.bar.com/",
      ],
      'redirectStatusCode' => 301,
    ]
];
chrisrowe commented 5 years ago

@selvinortiz Any plans or thoughts on this, I need to enforce SSL on two sites (separate domains) and would love to keep this in Patrol (so I can disable on staging/dev) rather than move to htaccess etc.

selvinortiz commented 5 years ago

Hi @chrisrowe, I'm sorry about the delay in getting back to you.

It sounds like we'd need to add support for this by modifying the primary domain enforcing routing in a couple of ways:

  1. Add support for multiple primary domains (array) rather than a single one (string)
  2. Add support for enforcing primary domain by checking against the current site handle

Is that kinda how you see it?

chrisrowe commented 5 years ago

@selvinortiz This sounds perfect yes!

hatzipanis commented 5 years ago

Is there an update on this? We'd love to use it on a Craft 3 build we've just done with multiple sites. The above solution is how I would have thought it would have worked as well.

selvinortiz commented 5 years ago

@hatzipanis Still on my todo. No release date planned for this yet.