Awesome Open Source
Awesome Open Source



Patrol simplifies SSL and maintenance routing for sites built with Craft CMS


  • Allows you to force SSL on specific areas of your site or globally
  • Allows you to put your site on maintenance mode and route traffic to your offline page
  • Allows you to define who can access your website during maintenance
  • Allows you to enforce a primary domain (primaryDomain environment config)
  • Allows you to limit control panel access (limitCpAccessTo environment config)

You can let users access your website during maintenance by:

  • Making them admins
  • Authorizing their IP address
  • Giving them this permission: Patrol > Access the site when maintenance is on

If you want to block all users, (including admins) during maintenance:

  • Add your email or username to limitCpAccessTo in your config file and login with that account


  1. Download the latest release
  2. Extract the archive and place patrol inside your craft/plugins directory
  3. Adjust file permissions as necessary

Environment Configs

You can configure Patrol from any environment definition. Here is an example of how you could go about setting that up...

// config/general.php
return [
    '*'    => [
        'environmentVariables' => [],
    '.dev' => [
        'patrol' => [
            'forceSsl' => false,
    '.com' => [
        'patrol' => [
            'primaryDomain'   => '*',
            'forceSsl'        => true,
            'restrictedAreas' => [
            'maintenanceMode' => false,
            'maintenanceUrl'  => '/offline.html',
            'authorizedIps'   => [
            'limitCpAccessTo' => ['[email protected]'],
            'enableCpTab'     => true,
            'pluginAlias'     => 'Patrol',


Patrol will throw an HttpException(403) for unauthorized users during maintenance if you do not have an offline page set up.

To force SSL everywhere (recommended practice), you can set / as the restricted area. If you only want to force SSL on the control panel, you could use /admin or /{cpTrigger}, the latter is recommended.

Help & Feedback

If you have questions, comments, or suggestions, feel free to reach out to me on twitter @selvinortiz


Patrol for Craft CMS is open source software, licensed under the MIT License

Open Source Initiative

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Php (391,791
Craftcms (594
Craft Plugin (360
Craft (174
Related Projects