How to switch from subdomains to subdirectories?

In this article, you will learn more about switching from a subdomain-based integration to a subdirectory-based one.



1. How to make the change from subdomains to subdirectories?


If you're not sure of the difference between subdomains and subdirectories, have a look at our guide, where we break down what they are and how to choose between the two of them.

If you still want to proceed with switching integrations, you must first deactivate your subdomain integration.

To do this, go to the Setup page of your projects (accessible via the Weglot dashboard). Then, deactivate the "Subdomains or Subdirectories" option.

A popup will appear asking you to confirm this decision. To continue, click on the "Remove" button:

After doing this, click again on the "Subdomains / Subdirectories" toggle button.

Next, provide your domain name URL. In the URL Type section, select "Subdirectories" in the dropdown menu.


Click on "Next", and you'll have reached the step called "Your DNS settings".

To continue setting it up, complete the following steps:

  1. Add a DNS record to your DNS manager. The "host", "type" and "value" needed to create this record will be given to you by Weglot.
  2. After adding the record to your DNS provider, go back to Weglot and click on the "Check DNS" button.
  3. The SSL certificate will then be validated. As it can take some time, you may have to wait a few minutes before clicking on the "Check DNS" button to see if the certificate has been validated.
  4. Now, you will have a new DNS entry displayed on your screen. You don't need to create a new record, as this one already exists in your DNS manager. But you will need to modify its value to put the one given by Weglot.

If you want to stop using the subdirectory integration in the future, you will need to revert this record to its previous value (needed to deactivate the integration).

We recommend you to take a screenshot of your current setting before changing it. In any case, Weglot will warn you about this should you attempt to deactivate the integration.

The DNS record you will have to modify will be different depending on whether you have a subdomain in your URL (e.g., www.mysite.com) or not (e.g., mysite.com).


If you don't have a subdomain in your URL (e.g., mysite.com):

The second DNS record will ask you to modify your A record.


You should only have one A record, so you'll need to modify your existing A record to match the value displayed on Weglot. You don’t have to create a new one.

You can safely change the target, as Weglot will keep the connection between your domain name and the servers you are using.

This configuration is needed to add the subdirectories to your domain and to create the translations server-side.

If you have several A records, you may face an error on Weglot's side. Do not hesitate to contact us at support@weglot.com and we will guide you to continue your setup.


If you have a subdomain in your URL (e.g. www.mysite.com):

The second DNS record will ask you to modify a CNAME record.

The process to follow here will be exactly the same as the one you followed to add the first DNS record, but here, we'll use a different record. 

Note that, depending on your setup, the subdomain can be an A record. In any case, the value should always be modified.


  1. After modifying the 2nd DNS record, you can save the changes and click on the "Check DNS" button. Your subdirectories will now take a few minutes to be initialized.

Note that it can take up to an hour for the subdirectories integration to be up and working as intended.


If you are facing difficulties setting up the subdirectories, do not hesitate to contact us at support@weglot.com.


2. How to redirect my old subdomain URLs?


When you switch from the subdomain integration to the subdirectory one, the old URLs corresponding to your subdomain(s) are no longer active.

To prevent having 404 "Not Found' errors on your website, Weglot will manage redirections from these old unused URLs to the new URLs corresponding to the new subdirectories.

To do this, Weglot needs you to keep the DNS records corresponding to your subdomains in your DNS manager.

If you accidentally delete them and see 404 "Not Found" errors on your website, you can still put the records back to their previous values in your DNS manager. Weglot will then handle the redirections.

If you don't remember the "values" of your DNS records, you can still contact us at support@weglot.com, and we will provide you with these values.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us