How to use subdirectories with Weglot
In this article, you will learn more about how to use the Weglot subdirectory integration.
This article is made for users who aren't using WordPress.
The Weglot integration on WordPress also uses subdirectories, but is different from the one explained in this article. To learn more about the integration of Weglot with WordPress, you can read this article we made.
The subdirectory integration is great for your SEO and allows your translated pages to be indexed by Google.
With this integration, your content is translated server-side, and you have a specific URL with the structure mywebsite.com/language_code/ for your translated versions.
The beginning of the process to set up the subdirectory integration will be different depending on whether you already have your Weglot project set up or not.
If you already have a Weglot project
You will need to go to your project settings (in your Weglot dashboard) and to the "Setup" tab.
Here, you can activate the "Subdomains or Subdirectories" option.
You will be redirected to the "Website details" setup phase.
If you don't have a Weglot project
In this case, you will need to create a Weglot account here (if you don't have one). You'll find and manage all your translations on this account.
When creating it, you'll need to verify your email address.
Next, when creating your Weglot project, you need to indicate your website technology. If it isn't available, select the “Other” option.
You'll then be asked to indicate the language of your website, and the language(s) you wish to translate it to:
You will then reach the "Website details" setup phase.
Once you are on the "Website details" step
Here, you need to indicate your website URL and select "Subdirectory":
Please note that your website needs to be publicly accessible to go for this Weglot integration.
You also need to manage your own domain name and have access to your DNS records.
After clicking on "Next", this screen will be displayed:
Use Quick Connect
Go to this part if you want to give access to your DNS records to Weglot (via Entri), so that we can automatically add the needed DNS records.
To see which DNS providers are compatible with Entri, you can read this article.
Set up DNS manually
Here, you will be given the DNS records that you need to add/modify so that you can make the necessary changes.
Skip this step
If you finally choose not to continue the subdirectory setup and prefer the JavaScript one, it is explained here.
Let's continue with the manual setup.
A first record to add to your DNS registrar is given to you.
Note that, depending on your setup, the record can be very different from the one in the screenshot below.
Once you have added the record and clicked on "Check DNS," the red cross will turn green, and you'll reach the next setup step.
Here, wait a few minutes and click on "Check DNS".
You will now be prompted to modify your main DNS record.
The record to change here will differ depending on your domain setup:
Weglot will maintain the link between your domain and your website.
Depending on the propagation time of your DNS records, you may experience a few minutes of downtime during this change. However, it shouldn't last, and you can still revert the DNS change you made.
After making the change, click "Check DNS" and "Next".
The subdirectories are being set. Wait a few minutes and click on the links provided to access them.
The setup is now finished, and you can go back to your translations:
If you are having trouble with the subdirectory setup, please feel free to contact us at support@weglot.com.