How can I customize the templates for 404, 500 error pages, and site shutdown notification pages?

Calendar 👁️ 76

As an experienced CMS website operation personnel for a security company, I am well aware of the importance of every user touchpoint, including those unusual pages, in carrying the brand image and user experience.Customized 404, 500 error pages, and site shutdown notification pages not only enhance the professionalism of the website but also provide guidance to users when they encounter problems, effectively reduce the bounce rate, and maintain a good search engine impression.

Next, we will discuss in detail how to customize these special pages in Anqi CMS.

Overview of Anqi CMS template mechanism

Anqi CMS adopts a flexible template engine, supporting Django template syntax, making template creation intuitive and efficient. All website template files are stored in the root directory under the/templateIn the folder, each independent template package has its own directory. For example, if you are using a template package nameddefault, then its file path is usually/template/default/. For templates that need to distinguish between PC and mobile ends, the mobile end templates are stored in the corresponding/mobile/subdirectory, maintaining a directory structure similar to that of the PC end. Template files are uniformly used.htmlas a suffix, and it is recommended to use UTF-8 encoding to ensure correct display.

Custom 404 error page: The Savior of User Experience

When the user visits a page that does not exist on the website, a 404 error is triggered.A generic, unguided 404 page can confuse users and even lead them to leave the website directly.By customizing the 404 error page, we can provide assistance to users when they are lost, guiding them back to the effective content of the website.

In Anqi CMS, the default template file path for the 404 error page is:errors/404.html. You need to create this file in the directory of the current template package, for example/template/default/errors/404.html. If your website has enabled the mobile template and you want to provide different 404 pages for mobile users, you can create them in/template/default/mobile/errors/404.htmlthe path.

When customizing a 404 page, it is recommended to include the following elements: A friendly message, such as 'Sorry, the page you are visiting does not exist';A search box for users to directly search for the content they need; links to the homepage, popular articles or categories, and the website map link;If you need, you can also leave your contact information. The design should maintain consistency with the overall style of the website, but avoid loading too many complex scripts or large images to ensure fast page loading and prevent any new errors.A valid 404 page can turn potential lost users into an opportunity to explore the website again.

Custom 500 error page: Graceful presentation of internal issues

The 500 error usually indicates that an unknown error occurred on the server.This error is not common, but when it occurs, the user will usually see a technically unfriendly page.Custom 500 error pages are crucial for maintaining a professional website image, even when the system encounters internal failures, as they can convey appropriate information to users.

The default template file path for the 500 error page in AnQi CMS is:errors/500.html. You need to create this file in the directory of the current template package, for example/template/default/errors/500.htmlSimilarly, the mobile template can be found in/template/default/mobile/errors/500.htmlthe path.

When designing a 500 error page, the most important principle is simplicity and clear information.The page should include an apology for the inconvenience caused to the users and inform them that the technical team is actively working on the issue.Due to 500 errors, system deep-level issues may be involved, page content should be as simple as possible, not dependent on complex database queries or external resources to avoid exacerbating problems during outages.Avoid exposing any error details on the page that may leak sensitive information about the server or application.Provide a customer service contact or a link to the website announcement page, which can increase the user's trust and patience.

Custom site shutdown prompt page: clear communication during maintenance

When a website needs to be temporarily closed for maintenance, upgrades, or other reasons, it is essential to provide users with a clear shutdown prompt page.This not only avoids confusion about the website status of the user, but also shows the professionalism of the operator.The AnQi CMS provides a convenient shutdown feature and allows you to customize the prompt content.

The default template file path for the site shutdown prompt page is:errors/close.html. You also need to create it in the directory of the template package you are using, for example/template/default/errors/close.html. The template path for the mobile end is/template/default/mobile/errors/close.html.

To enable the site shutdown prompt page, you need to set the "Website Status" to "Shutdown" in the Anqicms backend "Global Settings" and fill in the specific information you want to display to the user in the "Shutdown Prompt" field. Inerrors/close.htmlIn the template file, you can use{% system with name="SiteCloseTips" %}Tags to dynamically display the shutdown prompt content set in the background. The page content can include the reason for the shutdown, the expected recovery time, brand information, and other actions users can take during the shutdown period (such as following social media to get the latest updates).A rich and brand-consistent close prompt page that can effectively manage user expectations and reduce user dissatisfaction.

**Practice and Precautions

No matter which special page you customize, you need to follow some general principles.Ensure that the code on these pages is as lightweight as possible, loads quickly, and does not contain any code that may cause errors on its own.The page design should be consistent with your brand image, enhancing the sense of belonging of users.For the 404 page, it is still a page that search engines can crawl, so it should ensure basic accessibility and avoid duplicate content.After customization is complete, be sure to thoroughly test these pages by actually accessing non-existent links, simulating server errors (if possible), and setting the site offline status in the background, among other methods, to ensure they work properly in all scenarios and convey the correct information to users.


Frequently Asked Questions

Q1: If I have not created a custom template file for these special pages, how will Anqicms handle it?

A1:If you have not specified the path (such aserrors/404.html/errors/500.html/errors/close.htmlUnder it, create a custom template file, the Aqii CMS will usually display its built-in default error page or the general error information generated by the system.These default pages may be quite simple, not including your brand elements or detailed guidance information, and therefore it is strongly recommended to customize them to improve user experience.

Q2: Under the Anqi CMS multi-site management, can I set different 404, 500, and site shutdown prompt pages for each site?

A2:Yes, definitely. The multi-site feature of Anqi CMS allows each site to use an independent template package.This means you only need to create the files for these special pages in the corresponding template package directory for each site (for example,/template/site_a/errors/404.htmland/template/site_b/errors/404.htmlYou can customize the unique error and close prompt page design and content for each site.

Q3: How to ensure that my site's shutdown prompt page can dynamically display the shutdown information I set up in the background?

A3:In the one you customizeerrors/close.htmlIn the template file, you can use the system tags provided by AnQi CMS{% system with name="SiteCloseTips" %}. This label will directly read the content you enter in the "Global Settings" "Offline Prompt" field and display it on the page.This way, you can conveniently update the shutdown information without modifying the template file.

Related articles

What is the default naming rule for the template files of the model home page, document detail page, and document list page?

As an experienced CMS website operation personnel of an enterprise security, I know that a clear and efficient template naming rule is crucial for the management of website content and user experience.AnQi CMS provides great flexibility in template design and also establishes a set of default naming conventions, which is very helpful for us to quickly build and iterate web pages.In AnQi CMS, all template files are named with a `.html` extension and are uniformly stored in the `/template` folder under the system root directory.

2025-11-06

What should the default naming of the homepage template file be?

As an experienced CMS website operation personnel, I fully understand the importance of the homepage in attracting and retaining users. It is the first impression of users visiting the website and also the core hub of content layout and information communication.For Anqi CMS, understanding the naming conventions of its template files, especially the default naming of the homepage template file, is the foundation for ensuring the smooth operation and efficient management of the website.The Anqi CMS system defaults to identifying the homepage template file as `index.html`.This file is the entry point of your current theme template

2025-11-06

How to create and reference reusable code snippets like sidebars, breadcrumbs, etc. in templates?

As an experienced CMS website operation person in a security company, I am well aware of the importance of efficient content management and flexible template customization for website operation.In daily work, we often need to deal with various page elements, such as sidebars, breadcrumb navigation, headers, and footers, etc., which appear repeatedly on multiple pages.It is crucial to modularize and reuse these commonly used code snippets in order to improve development efficiency, ensure code consistency, and simplify maintenance work.AnQi CMS provides a powerful and easy-to-use template engine, allowing us to easily achieve this goal.

2025-11-06

How should common code snippets like headers, footers, etc. be organized and stored during template creation?

As a website operator familiar with Anqi CMS, I am well aware of the importance of a well-structured and easy-to-maintain template for the long-term healthy operation of the website.How to efficiently organize and store common page headers, footers, and other reusable code snippets during template creation is crucial for improving development efficiency and ensuring website consistency.In Anqi CMS, the template system uses a syntax similar to the Django template engine, which provides us with powerful tools to achieve code reuse and modular management.

2025-11-06

What are the differences between the 'Folder mode' and 'Flat mode' in the template file organization pattern?

As a senior security CMS website operations personnel, I am well aware of the importance of template file organization methods for website post-maintenance, content release efficiency, and team collaboration.In AnQi CMS, the organization mode of template files is mainly divided into two types: 'folder mode' and 'flattened mode', each with its own characteristics and suitable for different project needs and team habits.Understanding the differences between these two patterns can help us better choose and manage templates.First, let's delve deeper into the **folder organization pattern**.

2025-11-06

How to implement template customization for specific categories or pages, for example `page/about.html`?

As an experienced CMS website operator, I am well aware of the importance of content presentation for user experience and Search Engine Optimization (SEO).AnQiCMS provides a powerful and flexible template customization mechanism, allowing us to create exclusive visual and functional layouts based on different content types or specific page requirements.Today, I will detail how to implement template customization for specific categories or pages in AnQiCMS, such as the needs we often encounter, such as `page/about.html`.

2025-11-06

How to call and display the name, Logo, and other system global configuration information in AnQi CMS template?

As an experienced security CMS website operations personnel, I am well aware of the importance of the global configuration information of the website, such as the website name and logo, for the unified display of the brand image and user recognition.In AnQi CMS, these core information is unifiedly managed, and through a concise and efficient template tag mechanism, it allows operators to easily call and display on various pages of the website. ### Management of website global configuration information in AnQi CMS AnQi CMS centralizes the global configuration information of the website in the "Global Function Settings" module of the background.

2025-11-06

How to obtain and display the contact information, phone number, email, WeChat, and other contact methods set in the background?

Hello, as an experienced CMS operation person in the security industry, I know that clear and convenient contact information on the website is crucial for user experience and business conversion.Today, let's discuss in detail how to configure contact information in the Anqi CMS backend and display it flexibly and accurately on various positions of the website front-end. Configure website contact information: Back-end operation guide Managing website contact information in AnQi CMS is an intuitive and powerful process.First, we need to enter the background management interface for configuration.

2025-11-06