WebOps

Design & Strategy

We start with your goals and how your team works, then design the platform to match.

Website Builds

Custom Drupal, WordPress, and headless builds that perform from day one and stay easy to run.

Migrations

High-stakes CMS migrations from virtually any source onto a platform we support, with content and uptime protected.

Maintenance & Support

Proactive, senior-led care that keeps your platform secure, fast, and ready for what comes next.

AI Integration

Practical, native AI features built by the team contributing to Drupal’s AI core.

WebOps Audits

A clear, prioritized picture of your platform’s health and exactly what to fix first.

RevOps

CRM Implementation

HubSpot implementation built around how your team sells. We scope what is actually needed, configure what your team can operate, and hand off a system that works on day one.

CRM Migrations

Marketo, Eloqua, Pardot, and Salesforce moves into HubSpot. We treat every migration as a risk mitigation project, because for the VP who owns the pipeline, it is.

CRM Architecture

The structural decisions that shape everything downstream: object relationships, data governance, integration strategy, and managed data migration. Designed for how your team actually works.

Insights

Articles

Practical thinking on WebOps, RevOps, and running platforms that cannot fail.

Newsletter

Occasional, useful notes from the people doing the work. No noise.

Events & Talks

Where to find our team, from DrupalCon to industry meetups and webinars.

Our Work

About

Our Story

Why Digital Polygon exists, and the through-line behind every engagement.

Team & Leadership

The senior, global team you actually work with, named and accountable.

Careers

Join a senior team that builds the platforms and revenue systems people depend on.

Open Source

The modules we maintain, the initiatives we lead, and Polymer, our WebOps product.

How to Set Up Domain Access on Local using DDEV

Recently, we have been working on a number of Drupal 9 website platforms leveraging Domain Access and have noticed some challenges across teams with getting these environment setups running smoothly on local. Today we are excited to share that knowledge and walk you through our guide to getting Drupal 9 Domain Access platforms up and…

How to Set Up Domain Access on Local using DDEV

Recently, we have been working on a number of Drupal 9 website platforms leveraging Domain Access and have noticed some challenges across teams with getting these environment setups running smoothly on local. Today we are excited to share that knowledge and walk you through our guide to getting Drupal 9 Domain Access platforms up and running on local environments using DDEV!

Let’s start by quickly answering the question “what is domain access?”

Domain Access is a contributed Drupal suite of modules that adds an additional routing layer within your Drupal application to logically segregate websites on your Drupal platform. In more non-technical speak – it allows you to setup and manage multiple website domains from a single Drupal login/interface. Core functionality of Domain Access allows you to separate access for content, users, taxonomy, menus, etc., by website domain.

There is a large contrib space around the Domain Access module, and there are many add-on modules in the space.

Why is Domain Access a challenge in local environments? 

Domain access can be a challenge on local environments because it extends the traditional Drupal site capabilities to support multiple domains. To get this set up and running on a local environment, you need to be able to configure multiple domains for the application to respond from in order to test the functionality you are building/working with.

Now for the fun part – let’s jump in!

Technology Stack

In order to setup Domain access on the Local machine, we are using the below technology stack:

Prerequisite

  • Local Drupal 9 website installed with DDEV.

Local Setup

  • Use composer to add the Domain Access module
  • Enable the Module on your local machine.
  • Once the module is enabled, we will have an option to add different sub domains.

Navigate to Configuration > Domains > Domain records.

Image of domain access in Drupal backend
  • Link – <site-link>/admin/config/domain
  • Click on Add Domain records button
image of adding a domain record in Drupal backend
  • Link – <site-link>/admin/config/domain/add
  • This will show up a form which will allow us to add a new sub-domain.
image of adding a domain record in Drupal backend
  • Fill in all the required configuration and Hostname will allow you to create new Sub Domains.
  • Save the changes and the new Sub Domain is ready to be used on your local machine.

Local Configuration

Once the Drupal instance is installed, update the additional_hostnames section in config.yaml. Location for config.yaml is drupal/.ddev/config.yaml. For more details click here.

name: drupal

additional_hostnames:
- "fr.drupal"
- "es.drupal"
- "it.drupal"
  • Restart the ddev instance using:
ddev restart
  • Configure cross-domain logins – Decide if you want users to stay logged in while moving across sites. If it is necessary, widen the scope of cookie_domain in services.yml from example.com to .example.com
parameters:
  session.storage.options:
    cookie_domain: '.example.com'
  • Configure domain-sensitive caching if necessary – Decide if you need content to not stay cached when moving across domains. If you need that, append url.site to required_cache_contexts.

That is it – pretty simple when you take a step back and look at it! We hope this walkthrough helps you in your journey to build it better using Domain Access. Was this helpful? We would love to know if you would like to see more of this type of content.

Filed under

Keep reading

More from the field.

For projects that cannot fail

When it has to work. We deliver.

Tell us what you are working on. We will tell you honestly whether we are the right fit, and what a strong engagement looks like.