Skip to main content

Connect Shopify Store to a Custom Subdomain

Guide about Connect Shopify Store to a Custom Subdomain

Written by Mayank Baswal

Founder of is-cool-me · DNS & Platform Infrastructure

Mayank Baswal maintains the is-cool-me platform and writes technical guides focused on DNS configuration, subdomain infrastructure, SSL troubleshooting, deployment workflows, and platform reliability.

Reviewed by is-cool-me Technical Review
## Introduction Connecting a Shopify store to a custom subdomain is a crucial step for developers looking to create a seamless and professional e-commerce experience. With the rise of online shopping, having a custom subdomain can significantly enhance the credibility and trustworthiness of an online store. For instance, instead of having a store located at `myproject.shopify.com`, a custom subdomain like `store.myproject.is-pro.dev` can make the store appear more integrated with the rest of the project's ecosystem. This guide is tailored for developers setting up projects on is-cool-me subdomains, aiming to provide a comprehensive walkthrough of the process, from prerequisites to deployment scenarios. The motivation behind connecting a Shopify store to a custom subdomain is multifaceted. Firstly, it allows for better branding and customization, enabling developers to align their store's URL with their project's domain. This consistency can improve user experience and make the store more memorable. Secondly, having a custom subdomain can simplify the process of integrating the store with other services or applications within the project, as it can be treated as a part of the larger ecosystem rather than a standalone entity. Lastly, from a technical standpoint, a custom subdomain can offer more flexibility in terms of configuration and scalability, especially when dealing with complex project architectures. Understanding the importance of custom subdomains in e-commerce and development, this guide will delve into the technical aspects of connecting a Shopify store to a custom subdomain like `store.myproject.is-pro.dev`. It will cover the necessary prerequisites, step-by-step instructions, configuration options, common pitfalls, best practices, and troubleshooting tips, ensuring that developers have a thorough understanding of the process. ## Prerequisites Before connecting a Shopify store to a custom subdomain, there are several prerequisites that developers need to fulfill. Firstly, they must have an active Shopify account and a store set up. This involves creating a Shopify account, setting up a store, and configuring the basic settings such as store name, address, and currency. Secondly, developers need to have a custom domain or subdomain set up through a domain registrar or their project's platform, such as `myproject.is-pro.dev`. This requires purchasing a domain, setting up DNS records, and ensuring that the domain or subdomain is properly configured. Additionally, developers should have a basic understanding of DNS records, including A records, CNAME records, and TXT records, as these will be crucial in configuring the custom subdomain. They should also be familiar with Shopify's admin panel and know how to navigate through its various sections, including the "Online Store" and "Domains" sections, where the subdomain configuration will take place. Lastly, having a text editor or an IDE and being comfortable with running commands in a terminal can be beneficial, especially when dealing with more advanced configurations or troubleshooting. Below is a simple example of how to check DNS records using the `dig` command: ```bash dig +short myproject.is-pro.dev ``` This command can help verify that the domain or subdomain is correctly set up and resolving to the correct IP address. ## Step-by-step instructions To connect a Shopify store to a custom subdomain, follow these detailed steps: 1. **Log into Shopify**: Start by logging into the Shopify admin panel for the store you want to connect to a custom subdomain. 2. **Navigate to Domains**: In the Shopify admin panel, navigate to the "Online Store" section and then click on "Domains". 3. **Add a Domain**: Click on the "Add a domain" button and enter your custom subdomain, for example, `store.myproject.is-pro.dev`. 4. **Verify the Domain**: Shopify will prompt you to verify the domain. This involves adding a specific TXT record to your DNS settings. The record will look something like `shopify.verify myproject.is-pro.dev`. 5. **Configure DNS**: Go to your DNS settings (this could be through your domain registrar or your project's platform) and add the required TXT record. Then, add a CNAME record pointing to `shops.myshopify.com`. 6. **Set up SSL**: Ensure that SSL is enabled for your custom subdomain. Shopify provides an SSL certificate for custom domains, but this may require additional configuration. 7. **Test the Subdomain**: Once everything is set up, test the subdomain by visiting it in a web browser to ensure it resolves correctly to your Shopify store. Here's an example of how to add a CNAME record using the `aws` command-line tool for AWS Route 53: ```bash aws route53 change-resource-record-sets --hosted-zone-id Z1234567890 --change-batch '{ "Changes": [ { "Action": "CREATE", "ResourceRecordSet": { "Name": "store.myproject.is-pro.dev", "Type": "CNAME", "TTL": 300, "ResourceRecords": [ { "Value": "shops.myshopify.com" } ] } } ] }' ``` This command creates a new CNAME record for the `store.myproject.is-pro.dev` subdomain, pointing it to Shopify's servers. ## Configuration deep-dive When configuring a custom subdomain for a Shopify store, there are several options and settings to consider. The primary configuration involves setting up the correct DNS records, including the TXT record for verification and the CNAME record for routing. For example, the CNAME record for `store.myproject.is-pro.dev` should point to `shops.myshopify.com`. Another crucial aspect is ensuring that SSL is correctly configured. Shopify provides SSL certificates for custom domains, but this may require manually configuring SSL settings within the Shopify admin panel or through the domain registrar/platform. The SSL certificate is essential for securing the connection between the customer's browser and the Shopify store, preventing potential security warnings or errors. Additionally, developers may need to configure other settings, such as the store's URL structure, to ensure that it works seamlessly with the custom subdomain. This can involve updating the store's URL templates or configuring redirects for specific pages. The following table summarizes some of the key configuration options: | Configuration | Description | Example | | --- | --- | --- | | TXT Record | Verification record for Shopify | `shopify.verify myproject.is-pro.dev` | | CNAME Record | Points subdomain to Shopify | `store.myproject.is-pro.dev` -> `shops.myshopify.com` | | SSL Certificate | Secures the connection to the store | Automatically provided by Shopify | ## Common pitfalls and solutions Several common pitfalls can occur when connecting a Shopify store to a custom subdomain. Here are five potential issues and their solutions: 1. **Incorrect DNS Records**: If the DNS records are not set up correctly, the subdomain may not resolve to the Shopify store. **Solution**: Double-check the TXT and CNAME records to ensure they are correctly configured. 2. **SSL Certificate Issues**: Problems with the SSL certificate can lead to security warnings or errors when accessing the store. **Solution**: Ensure that SSL is enabled in the Shopify admin panel and that the certificate is correctly configured. 3. **Verification Failures**: If the verification process fails, the custom subdomain may not be recognized by Shopify. **Solution**: Check the TXT record for typos or incorrect values and retry the verification process. 4. **Redirect Loops**: Incorrectly configured URL redirects can cause redirect loops. **Solution**: Review the store's URL templates and redirect settings to ensure they are correctly set up. 5. **Performance Issues**: Slow loading times or performance issues can occur if the subdomain is not optimized. **Solution**: Use tools like Shopify's performance monitoring or third-party services to identify and fix bottlenecks. ## Best practices To ensure the best performance, security, and maintainability of a Shopify store connected to a custom subdomain, follow these best practices: - **Regularly Update DNS Records**: Keep DNS records up-to-date to prevent resolution issues. - **Monitor Performance**: Use performance monitoring tools to identify and fix bottlenecks. - **Enable SSL**: Always ensure that SSL is enabled to secure the connection to the store. - **Test Thoroughly**: Thoroughly test the subdomain and store after configuration to catch any potential issues. - **Keep Shopify and Themes Updated**: Regularly update Shopify and themes to ensure compatibility and security. ## Troubleshooting section When troubleshooting issues with a Shopify store connected to a custom subdomain, start by identifying the symptoms. Common issues include the subdomain not resolving, security warnings, or performance problems. Here are diagnostic steps for each: 1. **Subdomain Not Resolving**: Check DNS records, ensure the domain is verified in Shopify, and test the subdomain in different browsers. 2. **Security Warnings**: Verify that SSL is correctly configured, check for mixed content issues, and ensure that all resources are loaded over HTTPS. 3. **Performance Issues**: Use performance monitoring tools, optimize images and assets, and consider using a content delivery network (CDN). To debug failures, developers can use tools like the browser's developer console to inspect network requests and identify errors. Additionally, Shopify provides logs and performance metrics that can help diagnose issues. ## Deployment scenario from operations Consider a real-world deployment scenario where a developer wants to connect their Shopify store to a custom subdomain `store.myproject.is-pro.dev`. The store sells handmade crafts, and the developer wants to ensure a seamless and secure shopping experience. 1. **Setup**: The developer sets up the Shopify store, configures the basic settings, and designs the store's theme. 2. **Custom Subdomain**: The developer adds the custom subdomain `store.myproject.is-pro.dev` in the Shopify admin panel and verifies the domain by adding the required TXT record. 3. **DNS Configuration**: The developer configures the DNS records, adding a CNAME record pointing to `shops.myshopify.com`. 4. **SSL Configuration**: The developer ensures that SSL is enabled for the custom subdomain. 5. **Testing**: The developer thoroughly tests the subdomain and store, checking for any potential issues or errors. Here's an example of how to automate the deployment process using a `deploy.sh` script: ```bash #!/bin/bash # Verify domain aws route53 change-resource-record-sets --hosted-zone-id Z1234567890 --change-batch '{ "Changes": [ { "Action": "CREATE", "ResourceRecordSet": { "Name": "store.myproject.is-pro.dev", "Type": "TXT", "TTL": 300, "ResourceRecords": [ { "Value": "shopify.verify myproject.is-pro.dev" } ] } } ] }' # Configure CNAME record aws route53 change-resource-record-sets --hosted-zone-id Z1234567890 --change-batch '{ "Changes": [ { "Action": "CREATE", "ResourceRecordSet": { "Name": "store.myproject.is-pro.dev", "Type": "CNAME", "TTL": 300, "ResourceRecords": [ { "Value": "shops.myshopify.com" } ] } } ] }' ``` This script automates the process of verifying the domain and configuring the CNAME record, making it easier to deploy and manage the custom subdomain. ## Common mistakes Here are five common mistakes to watch out for when connecting a Shopify store to a custom subdomain: * **Incorrect DNS Record Configuration**: Failing to correctly configure DNS records can lead to resolution issues. * **Insufficient Testing**: Not thoroughly testing the subdomain and store can lead to undiscovered issues. * **SSL Configuration Errors**: Incorrectly configuring SSL can result in security warnings or errors. * **Verification Process Errors**: Failing to complete the verification process can prevent the custom subdomain from being recognized by Shopify. * **Performance Optimization Oversights**: Not optimizing the store's performance can lead to slow loading times and a poor user experience. ## How to verify it works To verify that the custom subdomain is correctly connected to the Shopify store, follow these steps: 1. **Visit the Subdomain**: Open a web browser and navigate to the custom subdomain, for example, `store.myproject.is-pro.dev`. 2. **Check for SSL**: Verify that the connection is secure by looking for the padlock icon in the browser's address bar. 3. **Test Store Functionality**: Test the store's functionality by navigating through different pages, adding products to the cart, and completing a test purchase. 4. **Check DNS Records**: Use tools like `dig` or `nslookup` to verify that the DNS records are correctly configured. 5. **Monitor Performance**: Use performance monitoring tools to ensure that the store is loading quickly and efficiently. ## Conclusion with next steps Connecting a Shopify store to a custom subdomain like `store.myproject.is-pro.dev` is a straightforward process that requires attention to detail and thorough testing. By following the steps outlined in this guide, developers can create a seamless and professional e-commerce experience for their customers. Next steps include monitoring the store's performance, optimizing for better user experience, and exploring additional features and integrations to enhance the store's functionality. ## FAQ Here are four frequently asked questions with detailed answers: **Q: What is the purpose of verifying a domain in Shopify?** A: Verifying a domain in Shopify is essential to prove ownership of the domain and to enable Shopify to configure the necessary DNS records for the custom subdomain. This process involves adding a specific TXT record to the domain's DNS settings, which Shopify then checks to confirm ownership. **Q: How do I configure SSL for my custom subdomain?** A: Configuring SSL for a custom subdomain in Shopify involves enabling SSL in the Shopify admin panel and ensuring that the SSL certificate is correctly configured. Shopify provides an SSL certificate for custom domains, but this may require additional configuration, such as setting up redirects for HTTP traffic. **Q: What are the benefits of using a custom subdomain for my Shopify store?** A: Using a custom subdomain for a Shopify store offers several benefits, including improved branding, better integration with other services or applications, and enhanced flexibility in terms of configuration and scalability. A custom subdomain can also make the store appear more professional and credible to customers. **Q: How do I troubleshoot issues with my custom subdomain?** A: Troubleshooting issues with a custom subdomain involves identifying the symptoms, checking DNS records, verifying SSL configuration, and testing the store's functionality. Developers can use tools like the browser's developer console, Shopify's logs, and performance monitoring tools to diagnose and fix issues. Additionally, ensuring that the store and themes are up-to-date can help prevent compatibility issues.
Share this article Share on X Share on LinkedIn

Explore More