---
title: "Using path-based domain names"
date: "2024-02-14T06:18:38+00:00"
summary: "Discover how to use path-based custom domains in Site Factory for greater flexibility in URL structures. Learn requirements, setup steps, and troubleshooting tips for seamless implementation."
image:
type: "page"
url: "/site-factory/using-path-based-domain-names"
id: "b774fb97-e7a7-49a3-9bbd-50a9d31b9d2b"
---

As described in [Adding custom domains to your site](/site-factory/manage/domains), you can add a custom domain name to an Site Factory website, such as `www.example.com` or `store.example.com`. Site Factory also supports using path-based custom domains for websites if you add custom code to your application. Path-based domains are custom domains in the form `www.example.com/foo` and `www.example.com/bar`. They enable more choice in custom domain names, and allow a single SSL certificate to handle many websites under the same URL.

Important considerations and requirements
-----------------------------------------

To use path-based custom domains, you must keep in mind the following considerations and [path-related issues](/site-factory/known-issues#acsf-known-path-domains):

*   Each website must use the [Site Factory Connector module](https://www.drupal.org/project/acsf) 8.x-1.53, 7.x-1.53, or later.
*   Path-based domains can [display incorrectly during code deployments](/site-factory/known-issues#acsf-known-issue-path-domains-deploy).
*   All websites using the same URL must exist on the same Site Factory [stack](/site-factory/stacks). For example, if you have a website on one stack with the domain `www.example.com`, you can’t have a website on a different stack with the domain `www.example.com/full`.
*   The path for a website can’t contain more than one subdirectory. For example, you can have a website at `www.example.com/gibbous`, but not at `www.example.com/phases/gibbous`.
*   For each website using a path-based custom domain, you must create a symbolic link (symlink) in the docroot directory. For more information, see [Creating symbolic links for path-based custom domains](#acsf-symlink-path-domains).

If your website has custom [db-update](/site-factory/extend/hooks/dbupdate) hooks, you must add Drush version 9.6 or later to your codebase, or ensure all domains passed to Drush commands contain a trailing slash.

For known issues about [path-based domains](#), see [Known issues with path-based domains](/site-factory/known-issues#acsf-known-path-domains).

Adding a path-based custom domain
---------------------------------

You can add a path-based custom domain (such as `www.example.com/gibbous`) in the [Site Factory Management Console](/site-factory/login) in the same way you add any custom domain. For more information, see [Adding your domain](/site-factory/manage/domains/point/cname-site#acsf-associate-cname-with-sub).

Creating symbolic links for path-based custom domains
-----------------------------------------------------

For a website `www.example.com` you want to create symbolic links for websites at `www.example.com/gibbous` and `www.example.com/crescent`, perform the following steps:

1.  In your code repository, change directories to your docroot directory:
    
        cd docroot
    
2.  Enter the following commands to create the symbolic links:
    
        ln -s . gibbous
        ln -s . crescent
    
3.  Commit the changes in your code repository.
4.  Associate the path-based domain name with the website, as described in [Adding your domain](/site-factory/manage/domains/point/cname-site#acsf-associate-cname-with-sub).
    
    Note
    
    The Site Factory Management Console will display a [DNS error message](#acsf-path-domain-dns-error) even if the addition is successful.
    

Resolving domain name conflicts
-------------------------------

If you try to assign a domain name already in use for another website, you will see an error message like the following example:

    Oops! Looks like there was a problem
    
    A domain can belong only to a single server group. This domain is already
    assigned to the ``xyz654`` server group via the ``example`` site. This site
    is served via the ``abc123`` server group.

To resolve the error, either choose a different domain name, or remove the conflicting domain name from the other website. It may take several minutes after removing a conflicting domain name before it becomes available for re-use.

DNS error message
-----------------

After you add a path-based domain to a website, the Site Factory Management Console displays a message like the following example:

    Your domain name has been successfully added to the site. The domain
    example.com/gibbous does not have a DNS record that points to this
    site. Confirm the domain and contact your DNS provider to add a CNAME or
    address record (A record) to point to example.gibbous.sfdev.acquia.com.

If you have already pointed your DNS records to your Site Factory website, you can ignore this message. A [known issue](/site-factory/known-issues) in Site Factory prevents this Site Factory Management Console page from performing DNS lookups for path-based domains.