Customizing your ShortStack campaign's domain, subdomain, or subfolder can provide benefits to marketing, branding, and SEO. Using these configurations, you can show your ShortStack campaign as if it exists on a domain you own. For example:
- Instead of using one of our domains, like: https://a.pgtb.me/ABC123
- You can instead publish to your own domain like: https://www.example.com or to a custom domain with a custom subfolder like: https://www.example.com/mycontest
Custom domain, subdomain, and subfolder configurations can be complex and should be performed by an IT professional. Your web host may be able to assist you.
- For DNS configurations: You must have the ability to manage DNS settings on your domain registrar.
- For embedding: You must have the ability to create files and folders on your hosted web server.
- For reverse proxy: You must have the ability to edit your web server's configuration file(s).
To ensure your ShortStack campaign is free from duplicate content issues with search engines, it is important to specify a canonical URL for your custom domain, subdomain, or subfolder. To do so:
- Add a new Code Widget with the following code, changing the href attribute to your custom domain, subdomain, or subfolder:
<link rel="canonical" href="http://mycontest.example.com/" />
- In the Placement section of the Code Widget settings, choose After <head>.
- Publish your changes.
- If you are pointing a root domain (example: acme.com), create an A record in your DNS that points to one of the following IP addresses:
- 126.96.36.199 (located in N. Virginia, USA)
- 188.8.131.52 (located in Sydney, Australia)
- 184.108.40.206 (located in Frankfurt, Germany)
Note: You can use any of these IP addresses, but for best performance, choose the one located closest to the majority of your visitors.
- 220.127.116.11 (located in N. Virginia, USA)
- If you only want to point a subdomain (example: contests.example.com), create an A record in your DNS for the subdomain (example: contests) that points to the same IP address you would've used for the root domain (listed above).
Note: If you're a ShortStack user with campaigns on our legacy server (S1), you can find instructions for your old campaign(s) in our DNS Configuration legacy doc.
- We automatically configure an SSL certificate for your domain upon the first request to our server. There is nothing you have to do on your end.
- Changes to DNS configurations may take several hours before the new settings are active.
There are two methods to host a ShortStack campaign within a subfolder on your domain (e.g. http://www.example.com/mycontest/): embedding and reverse proxy.
Embedding Your Campaign
- Create a new subfolder (e.g. "mycontest") on your hosted website. You may do this through your host's file management interface, via FTP, or several other methods.
- In this folder, add a bare-bones HTML file named index.html. See an example here.
- If you are using the example file, customize the Your page title and Your page description text.
- Embed your campaign by following the instructions in the Embedding a Campaign help doc. Paste the embed code into your barebones HTML file and save it to your web server.
Limitations of Embedding
Embedded campaigns utilize an HTML iFrame on a page hosted on your web server. iFrames show external sites on your page rather than inserting content directly into your page. This means that the content of your ShortStack campaign will not be indexed by Google or other search engines. To get around this limitation, use a reverse proxy as described below.
Note: This is an advanced configuration that should be performed by an IT professional. An incorrect configuration can cause your web server to crash.
A reverse proxy is a configuration on your web server that allows it to provide content from another server, such as ShortStack's campaign servers. This allows you to maintain ShortStack's SEO support.
To use a reverse proxy with a ShortStack campaign, it should point a non-existent subfolder on your web server to your published campaign's "web" address.
You may also need to set up a reverse proxy for this path:
- /fonts/: Point this path and all contained files and subdirectories to https://a.pgtb.me/fonts/
Because there are many ways to configure reverse proxies, we cannot provide exact instructions. Please see the relevant documentation for your web server.
When you publish to a custom domain, keep in mind that you are publishing to the exact URL you use - if it's published to a non-www URL, a www version of the same URL will not work without some updates on your domain's end. Keeping in mind that www is a subdomain, and using the example of publishing to a non-www URL:
- If you've published your campaign to a non-www URL, the preferred method to get the www version working would be to add a CNAME record for the URL that points it to the non-www version. This would be done via your domain name provider's interface for your account.
The CNAME record sets up the www version to point to the published non-www version, and the published non-www version is pointed to our servers using the A record you'd set up earlier.
- An alternate way to accomplish this would be to set up a separate A record for the www subdomain that also points to our IP. As long as you haven't published a different campaign using the www subdomain, the URL will resolve to the published non-www version of the campaign.
- If your domain is only being used for ShortStack, you might consider creating a wildcard CNAME record that uses * to point all subdomains to the root domain. Then you would be able to use other subdomains for other campaigns on the same domain.