Marketpath CMS Developer Tutorial Series

Domains

Last Updated 3/6/2018

Domains are not necessarily a developer feature, but developers should have a strong foundational knowledge of how domains work in order to get the most out of Marketpath CMS.

Every site on Marketpath CMS has at least one domain. Many sites have multiple domains.

Adding a Domain

Development Domain

We have an unlimited supply of free development domains for use by Marketpath CMS customers. These are easy to set up and free to use, but they come with one main drawback: They are long-ugly-Marketpath domains. Typically this makes them ideal for new website development efforts but you will probably want to swap them with your custom domain(s) prior to going live (more on that in a later lesson).

To set up a free development domain:

  1. Go to Site Settings -> Domains -> Add
  2. Check the checkbox next to "Use a free development domain"
  3. Type in your "Domain Name". This should just the "prefix" or "subdomain" you plan on using - the main domain is fully controlled by Marketpath.
  4. Select your "Development Domain". This is the domain controlled by Marketpath that your development domain will be a subdomain of.
  5. If your specified development domain has not already been taken, you will be able to "Save" and use your domain. If your specified development domain has been taken, you will have to specify a different development domain. Don't worry too much about it, though - it's just a development domain.

Custom Domain

We try to make it easy to add custom domains to your site, but for obvious security reasons we have to verify that you own the domain you are adding. There are three ways to verify your domain:

  • Using a TXT DNS record. One of the easiest ways to verify that you own your domain is if you have the ability to add DNS records for it. After adding the specified record, we will verify that it has been added and then you can remove the TXT record if you want.
  • Using a CNAME DNS record. Similar to the first method, we can verify that you own your domain by adding a CNAME record for a sub-domain. If you can't add TXT records, don't want to figure out how, or want to add multiple sub-domains at once, then this might be a good option for you while still being unobtrusive to any domains or subdomains currently in use. If for some reason you need to keep the subdomain "marketpath-verify" pointed to a different server then this option is not for you. And just like TXT records, you can remove the DNS record when you finished verifying that you own the domain.
  • Using a Meta Tag. If you have access to edit the site hosted at your domain, but do not currently have easy access to edit your DNS records then this could be a good option for you. Simply add the specified meta tag to the header of your homepage and we will know that you do in fact own your domain. As with the other two methods, feel free to remove the meta tag after verifying that you own your domain.

Note that verifying your domain is not the same thing as pointing it to Marketpath servers. When you are ready to go live with your Marketpath CMS website, you will need to direct your domain to server content from Marketpath servers instead of wherever they are currently served from. This means that if you (or your IT provider) do not currently have access to your DNS records, you will need to get access to them prior to going live.

Using SSL (https)

Every domain on Marketpath CMS can be accessed one of two ways: via http (insecure) or via https (secure). However, in order to access a resource using a secure link, the domain must have an SSL certificate.

Ordinarily, this is something that you would have to purchase from a third-party and install on your server (or have your IT team install it for you). This is still an option with Marketpath CMS if you want a "fancy" certificate using Organization Validation or Extended Validation. However, Marketpath CMS has the ability to generate and provide free Domain Validation SSL certificates for your domains.

The main catch is that you have to have your domain pointed to Marketpath CMS before generating the SSL Certificate. We also have to renew the certificate roughly every 30-60 days, so temporarily changing your DNS settings and then switching them back would not be a good strategy.

To generate and use an SSL Certificate to serve your pages using a secure url:

  1. In the management interface, navigate to Site -> Site Settings -> Domains and select the domain to serve over https.
  2. Set the "SSL Certificate" option to "Allow".
  3. Publish the Site Domain
  4. Wait. There is a lot happening behind the scenes now in order to generate and install your certificate. This process generally takes between 10 minutes and an hour, but can in some circumstances take up to a full day.
  5. Periodically check a page on your domain over the https:// protocol. This should be a page set up to "Allow" SSL. You will know that the certificate has been created and installed successfully when you load the page and do not see a security warning in your browser. You will not receive a notification of any kind when your waiting is complete - you will have to check manually in order to know that the process is finished.
  6. After your SSL certificate has been created, installed, and verified, you can optionally update the domain to force pages to load over https by editing the Site Domain and changing "SSL Certificate" to "Require". After saving and publishing, all pages loaded over http on that domain will automatically be redirected to load via https.

Redirecting a Domain

The easiest way to redirect traffic from one domain to another is to perform a Site Domain Swap. If you prefer the manual process, however, you can also create a redirect with the following options:

  • Use Regex: true (checked)
  • Origin: ^//old.domain.com/(.*)
  • Destination: //new.domain.com/$1
  • Is Permanent: true (checked) - unless you don't want it to be a permanent redirect

If there are pages that you actually want to be served from that domain, simply create the pages as you would have before. Requests are not redirected if they match a page that is published on the site instead. Kind of like a "special" 404 handler if you want to think of it that way.

Using Domains

Every page on Marketpath CMS has a domain. While it is possible to "alias" a page on multiple domains, the page itself only has one domain. Every page also has the ability to override the SSL settings of the domain. Under the "Advanced" options, setting the "Https" option to "http" will force the page to be loaded insecurely (over http) even if the domain has an SSL certificate. Setting the "Https" option to "https" will force the page to be loaded securely (over https), even when the previous page is loaded over https and the domain does not "Require" SSL. The default option, "either", will load the page insecurely if the domain does not have an SSL certificate, securely if the domain "Requires" an SSL Certificate, or else simply use the same protocol as page before it if the domain "Allows" an SSL Certificate but does not "Require" it.

Note that setting SSL Certificate on the domain to "None" (the default value) and the "Https" option on the page to "https" will force an infinite redirect loop. So will setting SSL Certificate on the domain to "Require" and the "Https" option on the page to "http".

---- End of Lesson ----

Question? Correction?

Let's work together to make our documentation as helpful as possible.

What is your name? 
What is your email address? 
Feedback: