AnQiCMS multilingual site domain configuration: Building a global content battlefield

Under the wave of globalization, it has become a norm for enterprises and self-media to provide content to users in different countries and regions.To enhance user experience, optimize search engine rankings (SEO), and establish an independent brand image, it is particularly important to configure independent domain names for each multilingual site.AnQiCMS is an enterprise-level content management system developed based on the Go language, with its powerful multi-site management and multilingual support capabilities, it can help us easily achieve this goal.

The design philosophy of AnQiCMS is to serve those who are eager to expand into the international market, manage multiple brands, or content branches.It provides a simple and efficient system architecture that makes the publishing, management, and promotion of content more convenient than ever before.Today, we will delve into how to configure a dedicated domain for each multilingual site in AnQiCMS, thereby building an efficient, flexible, and globally competitive content ecosystem.

Foundation of AnQiCMS multilingual and multisite capabilities

Before delving into the configuration, let's take a moment to review AnQiCMS's core strengths in this regard.The system is built with the "Multi-site Management" feature, allowing you to create and manage multiple independent websites from a unified backend.This means that no matter how many brands or sub-sites you have, you can centrally control them under one panel, greatly reducing repetitive work.At the same time, "Multilingual Support" is another highlight of AnQiCMS, allowing you to easily switch between languages for the content you publish, directly reaching users of different language groups.

Combining these two powerful functions, AnQiCMS provides us with an ideal platform to build a multi-language, multi-domain website matrix.The core idea is that an AnQiCMS instance can support multiple independent sites, and each site can carry multi-language content and bind their own exclusive domain names.

Core step: Configure a separate domain for each multilingual site

To configure independent domain names for each multilingual site in AnQiCMS, we need to perform server-side domain name configuration and the creation and association of AnQiCMS backend sites. The entire process can be divided into the following key steps:

Step 1: Prepare the domain and server environment

Before starting the configuration, make sure you have completed the domain registration and correctly resolved these domains (by adding an A record) to your AnQiCMS server IP address. Whether it isyour-en-domain.com/your-fr-domain.comOryour-es-domain.comAll need to point to the same server.

AnQiCMS is usually deployed on a specific port, such as the default one.8001Our goal is to allow external access to different domain names through this port, and be redirected to the corresponding site of AnQiCMS.This requires the use of reverse proxy features of a web server (such as Nginx or Apache) to be implemented.Whether you use a visual management tool like Baota Panel, 1Panel, or a pure command-line environment, the principles are the same.

Step 2: Configure reverse proxy on the web server.

The reverse proxy is the key to pointing multiple domains to the same AnQiCMS instance.It will forward external requests from different domains to the AnQiCMS internal listening port, and AnQiCMS will distribute the requests to the corresponding sites according to the domain name.

For example, using Nginx, assuming your AnQiCMS is127.0.0.1:8001running. You need to add a configuration for each domain in the Nginx configuration file.serverBlock, and configure the reverse proxy rules. At the same time, be sure to point the "site running directory" of each domain name to your AnQiCMS installation directory./publicfolder. thispublicThe directory is the root directory of AnQiCMS front-end static resources, ensuring the normal loading of web pages.

The following is an example of a Nginx configuration used toyour-en-domain.comandyour-fr-domain.comProxy to the same AnQiCMS instance:

# 英文站点配置
server {
    listen 80;
    server_name your-en-domain.com; # 替换为您的英文站点域名
    root /www/wwwroot/anqicms.com/public; # AnQiCMS的public目录

    location @AnqiCMS {
        proxy_pass http://127.0.0.1:8001;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    }
    error_page 404 =200 @AnqiCMS;
    location / {
       try_files $uri $uri/index.html @AnqiCMS;
    }
    access_log /var/log/nginx/your-en-domain.com.access.log;
    error_log /var/log/nginx/your-en-domain.com.error.log;
}

# 法文站点配置
server {
    listen 80;
    server_name your-fr-domain.com; # 替换为您的法文站点域名
    root /www/wwwroot/anqicms.com/public; # AnQiCMS的public目录

    location @AnqiCMS {
        proxy_pass http://127.0.0.1:8001;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    }
    error_page 404 =200 @AnqiCMS;
    location / {
       try_files $uri $uri/index.html @AnqiCMS;
    }
    access_log /var/log/nginx/your-fr-domain.com.access.log;
    error_log /var/log/nginx/your-fr-domain.com.error.log;
}

If you use Baota panel, this process will be simplified even more:

  1. First, add a website for each new domain as you would for a regular PHP site (keep the root directory default, choose static or do not create a database for the PHP version).
  2. Enter the "Settings" of each newly created website, set the "Running Directory" under the "Website Directory" to the directory under your AnQiCMS installation./publicand save.
  3. In the "pseudo-static" configuration, enter the above Nginx reverse proxy rules (if it is Apache, then directly in the reverse proxy settings to point to the above rules)http://127.0.0.1:8001) After completing these steps, restart the Nginx or Apache service to make the configuration effective.

Step 3: Add and configure a new site in the AnQiCMS backend

After the server-side configuration is complete, we need to create and associate these new multilingual sites in the AnQiCMS backend system.

  1. Log in to the backend management interface of the AnQiCMS site you have installed by default.
  2. Find and click the "Multi-site Management" feature in the left navigation menu.
  3. Click the 'Add new site' button to start configuring your multilingual site.
  4. In the pop-up configuration interface, you need to fill in the following key information:
    • Site Name:Choose a recognizable name for your new site, for example, 'English Official Website', 'French Site', etc.
    • Site root directory:This is a directory used for independently storing cache and configuration data for a new site.AnQiCMS is very intelligent, and even for multiple sites, it is recommended to use a single AnQiCMS codebase.The root directory is usually named with/app/The beginning (if it is a Docker environment) or the custom directory under your AnQiCMS physical path, for example/www/wwwroot/anqicms.com/en_siteIt is important to ensure that this directory name is unique and consistent with the directory you create for the site on the server (if independent file storage is needed).
    • Website address:Enter the independent domain name you have prepared for the site, for examplehttp://your-en-domain.com. AnQiCMS will recognize requests based on this address and distribute content accordingly.
    • Admin account password:Set an independent admin account and password for the new site.
    • Database name:Specify an independent database for the new site, for exampleyour_en_domain_db. AnQiCMS's 'Multi-site Management' allows each site to use an independent database, which greatly enhances data isolation and security.You can choose to “reuse the default database account information”, if your default AnQiCMS database user has sufficient permissions.
    • Select the template to use:Select an appropriate template for the site. Multilingual sites usually use the same set of templates, but the content data is independent.
  5. Click the "OK" button to complete the creation of the new site. Repeat the above steps for other multilingual sites.

After you have completed the creation of all sites, you can see all the newly added sites in the "Multi-site Management" list and directly enter their