Skip to main content
All CollectionsCustom DomainsFAQs
Applying a custom domain name to artifacts manually
Applying a custom domain name to artifacts manually
Tomohyco Tsunoda avatar
Written by Tomohyco Tsunoda
Updated over 3 years ago

Shifter supports external server deploying using with webhook and it enables you to copy generated contents to external services such as Netlify or Amazon S3 bucket.

You'll need to apply a custom domain name to it on Shifter.

Domain name replacement process on generating artifacts

The generator on Shifter Static will replace the URLs of the resources from the original to the URL of Shifter CDN or relative path. If your website has been published on Shifter, only you should do is applying the domain name to your website to rewrite URLs to the custom domain name; Shifter Static process it automatically.

If you're deploying artifact to external sever using webhook, you'll need to do it manually.

Domain name replacement process on generating artifacts

The generator on Shifter Static will replace the URLs of the resources from the original to the URL of Shifter CDN or relative path. If you're publishing the website to Shifter Static, apply the domain name to your site. Shifter Static will rewrite URLs to the custom domain name automatically.

If you're deploying artifact to external sever using webhook, you'll need to do it manually.

What happens if deploying artiafcts to the external server without applying a custom domain name.

Some URLs such as JavaScript files added by WordPress are still set as URL of Shifter CDN.

URLs of Shifter CDN (e.g. abc123on.getshifter.io) will exist on deployed resources such as JavaScript added by WordPress. So deployed site will call resources on Shifter CDN, not on the deployed server. It may require BASIC authentication if you set it on Shifter.

How to apply custom domain names manually

  1. Access the domain page of your Shifter site on the Shifter Dashboard.

  2. Add domain name, get CNAME records to verify domain ownership.

  3. Add CNAME records to your DNS server and complete domain verification.
    Please refer support document for more details of these steps.
    โ€‹Custom Domains on Shifter

  4. Attach domain name to the site by running a command on Shifter Domain CLI.

  5. Generate an artifact and confirm the custom domain name is applied.

Attaching domain name with Shifter CLI

Shifter Dashboard doesn't provide an interface to apply domain name for webhook published artifacts, currently.; but we're developing it. So, you'll need to do it with Shifter cli

Command

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

Example

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

Running the command without --no-shifter-cdn or set false (--no-shifter-cdn false), it will attach a custom domain name to the CloudFront on Shifter CDN. So, if you're trying to assign the domain name to your CloudFront after that, you'll get a failure error message.

Let's detach it on Shifter Dashboard then rerun the command with --no-shifter-cdn.

For more details of Shifter cli, refer to the Shifter cli support document and @shifter/cli - npm (npmjs.com) page.

Did this answer your question?