Manually Applying a Custom Domain to an Artifact

Manually Applying a Custom Domain to an Artifact Shifter supports deployment to external servers via webhooks, allowing you to copy generated content to external services such as Netlify or Amazon S3 buckets. To do this, you must apply a custom domain name in Shifter.

Domain Name Replacement During Artifact Generation

The Shifter Static generator replaces the original resource URLs with Shifter CDN URLs or relative paths.

  • When publishing to Shifter Static: Apply a domain name to your site. Shifter Static will automatically rewrite the URLs to use your custom domain name.
  • When deploying artifacts to an external server using a webhook: You must do this manually.

What Happens If You Deploy Artifacts to an External Server Without Applying a Custom Domain Name

Some URLs, such as JavaScript files added by WordPress, remain set to Shifter CDN URLs. Shifter CDN URLs (e.g., abc123.on.getshifter.io) remain in deployed resources such as JavaScript added by WordPress. As a result, the deployed site calls resources on the Shifter CDN rather than on the server it was deployed to. If you have set up Basic Authentication on Shifter, Basic Authentication may be required.

How to manually apply a custom domain name

  1. Go to the Domains page for your Shifter site in the Shifter dashboard.
  2. Add the domain name and obtain the CNAME record to verify ownership of the domain.
  3. Add the CNAME record to your DNS server to complete domain verification.
    • For more details on these steps, see Shifter Custom Domains (link to documentation).
  4. Run a command in the Shifter Domain CLI to attach the domain name to your site.
  5. Generate an artifact and verify that the custom domain name has been applied. For more details on these steps, see Shifter Custom Domains (link to documentation)

. Attaching a Domain Name Using the Shifter CLI

The Shifter dashboard does not currently provide an interface for applying a domain name to an artifact published via a webhook. However, this feature is under development. Therefore, you must perform this task using the Shifter CLI.

Command Example

$ shifter domain:add --username USERNAME --password PASSWORD --site-id xxx-YOUR-SITE-ID-xxxx --domain REPLACE-WITH-YOUR-DOMAIN-NAME --no-shifter-cdn

Specific Example

$ shifter domain:add --username shifter --password abc123 --site-id 7bf1bed4-a8fe-11e7-ae62-f2f909c1ded2 --domain shifter.example.com --no-shifter-cdn

Note: If you run the command without specifying –no-shifter-cdn, or set it to false (–no-shifter-cdn false), the custom domain name is attached to CloudFront on the Shifter CDN. As a result, an error message will appear if you later try to assign the domain name to your own CloudFront. Detach it in the Shifter dashboard, then run the command again with –no-shifter-cdn specified.

Shifter CLI Details

For more information about the Shifter CLI, see the Shifter CLI support documentation and the @shifter/cli – npm (npmjs.com) page.