As described in Adding custom domains to your site, 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:
- Each website must use the Site Factory Connector module 8.x-1.53, 7.x-1.53, or later.
- Path-based domains can display incorrectly during code deployments.
- All websites using the same URL must exist on the same Site Factory stack. 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 domainwww.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 atwww.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.
For known issues about path-based domains, see Known issues with path-based 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 in the same way you add any custom domain. For more information, see Adding your domain.
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:
In your code repository, change directories to your docroot directory:
cd docroot
Enter the following commands to create the symbolic links:
ln -s . gibbous ln -s . crescent
- Commit the changes in your code repository.
Associate the path-based domain name with the website, as described in Adding your domain.
Note
The Site Factory Management Console will display a DNS error message 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 in Site Factory prevents this Site Factory Management Console page from performing DNS lookups for path-based domains.