As a senior security CMS website operation personnel, I know well the importance of mobile experience for user retention and search engine optimization.In AnQiCMS, the flexible template mechanism allows us to decide whether and how to configure the mobile end address according to different operational strategies and technical requirements.
When is it necessary to configure the mobile end address of AnQiCMS?
AnQiCMS provides three main website modes to handle mobile end access, they are:Adaptive Mode/Code Adaptation ModeandPC+Mobile Site Mode Independent Mode. Whether the configuration of a separate mobile end address is required depends on the website mode you choose.
InAdaptive ModeBelow, the website will use a set of templates and adjust the layout and style automatically based on the screen size and resolution of the accessing device using technologies such as CSS media queries (Media Queries). In this mode, the PC and mobile ends share the same URL and content, thereforeIt is not necessaryConfigure a separate mobile end address. AnQiCMS system will automatically recognize the device and render the corresponding style.
When you chooseCode Adaptation ModeWhen, AnQiCMS allows you to design two independent templates for PC and mobile ends.The system identifies the access device by detecting the User-Agent and switches to the corresponding template file automatically.mobile/The template under the directory.Although in this mode, the PC and mobile ends usually use the same domain name, but if you want to strictly separate management or for some specific SEO considerations, you can consider configuring a separate address for the mobile end.However, the AnQiCMS system itself can seamlessly switch templates under the same domain in code adaptation mode, without requiring a separate mobile end address.
And forPC+Mobile Site Mode Independent ModeThis is the most clear scenario that needs to be configured for the mobile end address. In this mode, you will set a primary domain name for the PC website (for example,www.example.comSet a separate subdomain for the mobile website (for examplem.example.com)。This mode will allow PC and mobile end to have completely independent content management, template design, and URL structure, thereforeMustExplicitly configure the mobile end address in the background to ensure that mobile devices can be correctly guided to the exclusive mobile site.The design of Anqi CMS allows each site to independently manage its content and presentation in this mode, achieving fine-grained operation.
In short, if you adoptPC+Mobile Site Mode Independent Modeor inCode Adaptation ModeThere is a specific independent domain name requirement, and you need to configure the mobile end address of AnQiCMS.
How to ensure that the AnQiCMS mobile end address can be accessed normally
Ensure that the mobile end address of AnQiCMS can be accessed normally is a multi-step process, involving template preparation, domain resolution, background configuration, and server environment settings.
Firstly,Template preparation is fundamental.If you choose the code adaptation or PC+mobile independent site mode, you need to ensure that your template design includes a dedicated mobile template.mobile/In the subdirectory.mobile/The structure within the directory should be consistent with the directory structure of the main site template so that the system can find and correctly load the corresponding mobile page template. For example, if the home page on the PC end isindex/index.html, then the corresponding file for the mobile home page should bemobile/index/index.html.
Secondly,Domain name resolution is a key stepEnglish for mobile website configuration means you need a dedicated domain name or subdomain, such asm.example.com.This domain must be resolved by DNS at your domain provider and pointed to the IP address of your AnQiCMS server.The correct DNS resolution is the prerequisite for users to access your mobile website.
Next,AnQiCMS backend configuration is indispensable.Log in to your AnQiCMS backend management interface, navigate to the "Global Function Settings" under "Backend Settings".Here, you will find an input box named “Mobile end address”.https://m.example.comThis setting will inform AnQiCMS system that when a mobile device accesses, the user should be redirected to this address or generate a link to this address in the template (for example, through{% system with name="MobileUrl" %}Label).Make sure that the URL you enter is accessible and correct, otherwise it will cause the mobile website to fail to access normally.
Finally,The configuration of the server environment is crucial..Your web server (such as Nginx or Apache) needs to be configured with appropriate reverse proxy rules to correctly handle requests directed to mobile endpoints.server块(for Nginx)orVirtualHost(for Apache)。In this configuration, you need to set all the traffic that is sent tom.example.comThe request is forwarded to the internal port (default 8001) of the AnQiCMS application through a reverse proxy. This usually involves setting theserver_namecommand to your mobile domain and settingproxy_passCommand points tohttp://127.0.0.1:8001。For example, the Nginx configuration may look like this:
server
{
listen 80;
server_name m.example.com; # 您的移动端域名
root /www/wwwroot/your-anqicms-dir/public; # AnQiCMS的public目录
location @AnqiCMS_mobile {
proxy_pass http://127.0.0.1:8001; # AnQiCMS监听的端口
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_mobile;
location / {
try_files $uri $uri/index.html @AnqiCMS_mobile;
}
access_log access.log;
}
After completing the server configuration, please restart your web server to make the changes take effect.Only when all these links are properly configured, the AnQiCMS mobile end address can be accessed normally by users and provide the expected mobile end experience.
Common Questions (FAQ)
1. What are the core differences between AnQiCMS's adaptive, code adaptation, and independent PC+mobile site mode?
The adaptive mode uses a set of templates and the same URL to automatically adapt to different screens. The code adaptation mode switches to different templates under the same domain according to the device type (for examplemobile/The template under the directory), the URL remains unchanged.PC+手机端独立站点模式则为PC和移动端分配了完全独立的域名和模板,实现彻底分离,需要独立的移动端地址。
2. Do I need to set a separate domain for the mobile website?
This depends on the website model you choose. If you are usingAdaptive ModeIt is not necessary to have a separate mobile domain.Code Adaptation ModeEnglish version: The system can automatically switch templates under the same domain, usually without the need for a separate mobile domain. But if you have chosenPC+Mobile Site Mode Independent ModeThen setting a separate mobile domain is necessary, for examplem.example.com.
3. I have configured the mobile end address of AnQiCMS, but the website cannot be loaded or shows an error when accessed, how should I troubleshoot?
First, check yourDomain resolutionAre they correct, ensure that the mobile domain is pointing to the IP of the AnQiCMS server. Secondly, confirm the "Global Function Settings" in the AnQiCMS background.[en]Mobile end address”填写无误且完整(包含协议)。然后,核对您的Web服务器(Nginx/Apache)的 EnglishReverse proxy configuration,确保为移动端域名设置了正确的 Englishserver_nameandproxy_passThe rule has been restarted and the Web server. Finally, check yourmobile/template directoryDoes it exist, and the internal template file structure corresponds to the PC end template to ensure that AnQiCMS can find and render the mobile page.