How to implement independent display of multi-site content in AnQi CMS?

Calendar 👁️ 59

In today's internet environment, businesses and content operators often need to manage multiple independent websites, each of which may represent different brands, product lines, or content themes.AnQiCMS (AnQiCMS) provides a powerful multi-site management capability, offering users an efficient and flexible solution that makes it possible to independently display the core content of each site under a unified backend management interface.

Overview of AnQiCMS multi-site management capabilities

AnQiCMS was initially designed with the need for multi-site management in mind.It allows users to create and maintain multiple independent websites through a core system.This means that whether it is the front-end display style of the website, the content published, or the data storage, they can all be independent of each other and not affect each other.This centralized management, independent content model greatly simplifies the operator's workflow, improves efficiency, and is particularly suitable for users with multi-brand strategies or those who need segmented content operations.

The core of this "independent display" lies in AnQiCMS's clever binding and isolation of the front-end domain, back-end site configuration, and data storage.When a user visits different domain names, AnQiCMS can identify which site the current request belongs to and automatically load the corresponding site's configuration, template, and content, thereby ensuring that each site can have its unique user experience and information presentation.

The key steps to achieve independent display of content

Make full use of the multi-site feature of AnQiCMS and ensure that the content of each site can be truly independently displayed, we can follow the following key steps:

First, environment preparation and deployment strategy

The deployment of AnQiCMS is very flexible, whether through Docker, Baota panel, or command line, it can build its running environment. An important prerequisite for implementing multi-site management is,An AnQiCMS instance can support the operation of multiple independent websitesThis means we do not need to deploy a separate AnQiCMS program for each site.

At the server level, we need to configure reverse proxy to differentiate between different sites. For example, using web servers like Nginx or Apache, to map different domain names (such asbrandA.comandbrandB.comThe request is unified forwarded to the port where the AnQiCMS program is running (default is 8001).The web server routes requests to AnQiCMS based on the visited domain name, and AnQiCMS identifies the corresponding site based on the domain name.

In particular, in the Baota panel or other environments, you will create a website configuration for each new site, and set up its reverse proxy rules, directing all requests from the domain to your AnQiCMS main program (for examplehttps://en.anqicms.com)。This way, external users accessing through different domain names will be responded to by the same AnQiCMS instance.

Second, add and configure a new site in the AnQiCMS backend.

Once the server environment is ready, we can create and configure a new site in the AnQiCMS backend. This is a core operation step to achieve independent content display.

Enter the AnQiCMS backend management interface and find the "Multi-site Management" feature.Here, you can click "Add a new site" to create a brand new standalone website.In the pop-up configuration interface, there are some key information that needs to be filled in carefully:

  • Site nameThis is the internal name you set for convenience to distinguish different sites in the background.
  • Site root directoryThis item is crucial. Although multiple sites share the same AnQiCMS program file, their cache, uploaded files, and other data need to be stored independently.Therefore, it is recommended to set up a separate, domain-named root directory for each site (for example/app/dev_anqicms_comEnsure the isolation of the data file.
  • website address: Enter the complete domain name of the new site, for examplehttp://dev.anqicms.com. AnQiCMS will identify the current visited site based on this address.
  • Administrator account password: Create a set of independent backend management accounts and passwords for the new site.
  • Database nameTo achieve complete independence of content, each site should have its own independent database. Typically, the format of the site domain name can be used to name the database (such asdev_anqicms_com),avoid data confusion.
  • Duplicate database informationIf all your sites use the same database server and account system, you can choose to reuse the default database account information to simplify configuration.
  • Select the template to useHere, you can choose a completely independent front-end template for the new site. This means that each site can have its unique appearance and user interface.

By the above configuration, AnQiCMS can allocate independent storage space and database tables for each registered domain, thus achieving strict isolation at the data level.

The flexible application of content models and data isolation

AnQiCMS provides a highly flexible content model feature, allowing users to customize various content types according to business needs, such as articles, products, news, etc.Under multi-site scenarios, the role of the content model is further amplified.

Each site can define and use a completely independent content model and its fields according to its own characteristics.For example, an e-commerce site can have a "product model" that includes price, inventory, and other fields;And a news information site can use the 'article model', including fields such as author, source, and the like.Due to each site having an independent database, the data of these content models is also isolated from each other, ensuring the independence and purity of the content.

When you publish content in the background, select the corresponding site and content model, and the content you publish will only be stored in the database of that site and displayed only on the front end of that site.

Four, ensure the template design displays the content independently

The independent display of front-end content ultimately needs to be realized through a flexible template system.AnQiCMS's template design follows a clear convention, allowing each site to have a completely independent visual style and layout.

When creating a new site, you can specify a dedicated template package for it.This template package can include independent styles, scripts, and HTML structure.AnQiCMS template tags (such asarchiveList/categoryList/pageDetailVery smart:When deployed in the front-end template of a specific site, it will automatically retrieve and display the data of the current site by default.For example, inbrandA.comin the template.{% archiveList archives %}will only display.brandA.comThe list of articles on the site.

This is the key to achieving 'independent content display'.You do not need to manually specify the site ID in each tag, the system will automatically identify and load the content of the corresponding site based on the current access domain.Of course, if you indeed have a need to display cross-site content (such as displaying selected content from child sites on the main site), AnQiCMS also providessiteIdParameters allow you to explicitly specify which site to retrieve data from in the tag. However, for most cases of independent display, the default automatic recognition mechanism is already strong and convenient.

By combining the independence of content models, databases, front-end templates, and reverse proxies at multiple levels, AnQiCMS provides a comprehensive and powerful solution for multi-site operations, allowing each site to have its unique vitality.


Frequently Asked Questions (FAQ)

  1. How do the data of all sites that share an AnQiCMS instance achieve independent storage?AnQiCMS assigns one to each newly created siteindependent database nameandindependent site root directoryTo implement data isolation. When adding a new site in the background, you need to specify a database name and file directory that do not duplicate with other sites.This way, the content of each site (articles, products, categories, etc.) is stored in its own database, and file resources (images, attachments) are stored in its own root directory, ensuring that the data does not interfere with each other.

2

Related articles

How to display complex fields (such as image groups) customized by the background content model in AnQiCMS templates?

In Anqi CMS, the flexibility of website content is one of its core advantages.Through the powerful content model function, we can customize various fields according to business needs, thereby realizing diverse content display.It is particularly important to understand the data structure and template tag usage when we need to display complex fields customized by the background content model, such as image groups.

2025-11-07

How to replace a specific keyword in a string with another keyword and display it in AnQiCMS?

During the operation of a website, we often encounter the need to flexibly adjust specific text on the page.Sometimes it's to correct spelling errors, sometimes it's to unify brand terms, or maybe just for A/B testing.AnQiCMS (AnQiCMS) is an efficient content management system that fully considers these detailed requirements and provides simple yet powerful tools to help us achieve these goals.Today, let's talk about how to easily replace a specific keyword with another one in AnQiCMS

2025-11-07

How to print the detailed structure and value of variables for debugging in AnQiCMS template?

During AnQiCMS template development, we sometimes encounter variables that are not displayed as expected, or need to gain a deeper understanding of the specific structure and value of a variable in order to better perform content layout and logical control.AnQiCMS uses a syntax similar to the Django template engine, simple yet powerful, but even so, mastering debugging skills can also make our development process smoother and more efficient. Today, let's talk about how to accurately view the detailed structure and value of variables in the AnQiCMS template, allowing you to have a deep insight into the data in the template.###

2025-11-07

How to display any custom content of the background custom settings in the template of AnQiCMS (such as the custom help page URL)?

In website operation, we often encounter situations where we need to quickly adjust some information, such as updating the help page link, changing the status of a feature switch, or displaying some infrequently changed but flexible custom text on the page.If each modification requires delving into the code file, it will undoubtedly greatly reduce efficiency.AnQiCMS (AnQiCMS) fully understands this pain point and therefore provides a very convenient custom setting mechanism that allows you to easily configure any content in the background without writing code, and display it in the website template.### Backend Settings

2025-11-07

How to customize the content model of AnQi CMS to meet the display needs of different content types?

In website operation, we often encounter such situations: different types of content require different fields to describe and display.For example, a news article may only need a title, content, and publication time; while a product detail page may require product name, price, inventory, image set, and detailed parameters, etc.If all the content is cramped into a fixed template or data structure, it not only leads to chaos in management, but also makes the front-end display look awkward.

2025-11-07

How to use the multilingual feature of AnQi CMS to display content in different languages?

In today's global digital environment, the diversity of website content has become the key to attracting and retaining users from different regions.AnQiCMS (AnQiCMS) fully understands this need, providing flexible and powerful multilingual functions to help users easily display content in different languages, thereby effectively expanding market influence.This article will deeply explore how to utilize the multilingual capabilities of Anqi CMS, from backend configuration to frontend display, to achieve full internationalization of website content.### One, Embrace Multilingual: Why It's Crucial for Your Website?

2025-11-07

How to optimize the URL display and improve SEO of the pseudo-static function in AnQi CMS?

In website operation, a clear and friendly URL address not only allows visitors to understand the page content at a glance, but is also an indispensable part of search engine optimization (SEO).A disorganized, dynamic URL with a large number of parameters, which may deter search engine spiders and make it difficult for users to remember and share.AnQi CMS knows this, integrating SEO-friendliness into the system from the very beginning, and its powerful static function is the highlight of it.What is pseudo-static and why is it so important?

2025-11-07

How to import content in bulk and display it efficiently on the front end?

In today's fast-paced digital world, updating and maintaining website content is the key to successful operation.Especially for websites with massive amounts of information or those that need frequent updates, how to efficiently batch import content and present it beautifully on the front end has become a challenge that every operator must face.AnQiCMS as an enterprise-level content management system provides a powerful and flexible solution in this regard, making content management easy and effortless.

2025-11-07