- Plesk Onyx for Linux
How to configure WPML WordPress plugin on a Plesk Server to use different domains per language? E.g example.com for English language and example.cn for Chinese?
There is no limitation from Plesk side in order to achieve such a setup, however it is possible to simplify it via Plesk Interface.
- The first thing to do is to create an A record for all required domains to point to the server's IP. That is a task that lies outside of Plesk Server unless Plesk Server is the authoritative NS server for DNS management.
- Then, it is required to add example.cn as a Server Alias to Web Server Configuration files. In Plesk that can be done by creating a Domain Alias. It can be done via Subscriptions > example.com > Add Domain Alias. It should be created without SEO safe redirect:
This will automatically add
server_namedirective to Web Server configuration files for the example.com domain:
# grep -r 'example.cn' /var/www/vhosts/system/example.com/conf/
/var/www/vhosts/system/example.com/conf/nginx.conf: server_name example.cn;
/var/www/vhosts/system/example.com/conf/nginx.conf: server_name www.example.cn;
/var/www/vhosts/system/example.com/conf/httpd.conf: ServerAlias "example.cn"
/var/www/vhosts/system/example.com/conf/httpd.conf: ServerAlias "www.example.cn"
Note: In case Plesk is responsible for DNS management, then required A records will be created automatically by Plesk on this step.
- Install Let's Encrypt SSL Certificate on the Domain Alias via Domains > example.cn > Let's Encrypt.
- Follow this guide in order to configure WPML Plugin itself:
How to use WPML with different domains per language