AnQiCMS multi-language site domain configuration: Build a global content fortress

Under the wave of globalization, it is common for companies and self-media to provide content to users in different countries and regions in English.In order 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 as an enterprise-level content management system developed based on the Go language, with its powerful multi-site management and multi-language support capabilities, 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, making the publishing, management, and promotion of content more convenient than ever.Today, we will delve into how to configure a dedicated domain for each multilingual site in AnQiCMS, thus building an efficient, flexible, and globally competitive content ecosystem.

Foundation of AnQiCMS multi-language and multi-site capabilities

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

Combine these two powerful features, AnQiCMS provides an ideal platform for building 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 multilingual content and bind their respective exclusive domain names.

核心步骤:为每个多语言站点配置独立域名

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

第一步:Prepare domain and server environment

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

AnQiCMS is usually deployed on a specific port, such as the default one.8001.Our goal is to allow external access to different domains to be redirected to the corresponding site of AnQiCMS through this port.This needs to utilize the reverse proxy feature of a web server (such as Nginx or Apache).No matter whether you are using a visual management tool like Baota Panel or 1Panel, or a pure command-line environment, the principles are the same.

Step 2: Configure reverse proxy in the web server

Reverse proxy is the key to directing multiple domains to the same AnQiCMS instance.It will forward external requests from different domains to the ports listened by AnQiCMS internally, and AnQiCMS will distribute the requests to the corresponding sites according to the domain names.

For example, using Nginx, suppose your AnQiCMS is127.0.0.1:8001running. You need to add a configuration for each domain in the Nginx configuration file.serverBlocks, and configure reverse proxy rules. At the same time, please make sure that each domain's "website running directory" points to your AnQiCMS installation directory under/publicthis folder.publicThe catalog 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.comTranslated to English: Proxy 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. Firstly, just like adding a normal PHP site, create a website for each new domain (the root directory remains default, and choose pure static or not create a database for the PHP version).
  2. Enter the "Settings" of each newly created website, set the "Running Directory" in the "Website Directory" to your AnQiCMS installation directory./publicAnd save.
  3. In the "pseudo-static" configuration, enter the above Nginx reverse proxy rules (if it is Apache, then directly point to the reverse proxy settings)http://127.0.0.1:8001).English Complete these steps and then restart the Nginx or Apache service to make the configuration effective.

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

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

  1. Login 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 name for your new site that is easy to recognize, such as “English Official Site”, “French Site”, etc.
    • Site root directory:This is a directory used for independently storing new site cache and configuration data.AnQiCMS is very intelligent, even for multiple sites, it is recommended to use a single AnQiCMS codebase./app/Start (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 created for the site on the server (if independent file storage is needed).
    • Website address:填写您为该站点准备的独立域名,例如 Englishhttp://your-en-domain.com。AnQiCMS会根据这个地址识别请求并分发内容。 English
    • Administrator account password:Set an independent admin account and password for the new site.
    • Database name:为新站点指定一个独立的数据库,例如 Englishyour_en_domain_db.The “Multi-site Management” of AnQiCMS allows each site to use an independent database, which greatly enhances data isolation and security.You can choose to 'Reuse default database account information', if your default AnQiCMS database user has sufficient permissions.
    • Select the template you want to use:Select an appropriate template for this 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 completing the creation of all sites, you can see all newly added sites in the "Multi-site Management" list and directly enter them by clicking the "Access Backend" button.