What codes should be returned for deleted articles and hidden columns, and what consequences will there be if they are all compressed into 404?

📅 2026-10-11 👁️ 13

When the content is deleted or the column is hidden, the status code is unified into 404, leading to the direct consequence that the event of 'the path is still there, but the content has another status' is interpreted as 'the content does not exist'. PbootCMS treats this as an issue that needs to be fixed: the release notes of V3.2.23 state that returning 404 uniformly due to front-end semantic errors will cause existing pages to be demoted, and the solution is to分流 to 403, 500, and 503 based on semantics. The分流 is not to return more codes, but to allow the reader to make a long-term judgment that is consistent with the true status of the content.

Why is it unified into 404?

In fact, this is the most convenient way: as long as the content is not obtained, go with the same error template. It covers three completely different facts - the content was indeed deleted; the content is still there but not displayed to the public; the content is there, but an error occurred during the data acquisition process. To the visitor, it is all 'not visible', but to the crawler and monitor, it is three different processing signals.

Another reason is the boundary between the template and the route. After the pseudo-static address passes the path parameters to the program, the conditional branch is often written at the level of whether the data acquisition result is empty, while the information about status and permissions has already been determined in the previous steps and has not been brought to the exit.

What are the consequences of misjudgment?

The demotion is just the surface. The real cost is the difficulty of rollback: after the content is relaunched, the address needs to be re-evaluated as valid, and the cycle is much longer than the time of delisting; if the hidden column is temporarily closed, being read as invalid is equivalent to erasing the entire category's historical accumulation.

At the same time, reporting service exceptions as 404 will make the monitoring lose the clue. Database connection failures, template data retrieval errors, and content not found are mixed together, and the on-duty person can only look through the logs, and cannot classify directly from the return codes.

Where does the difference between deleting and hiding lie?

Deleting means that the content is no longer accessible and usually has a retention period. The status of documents within the site is divided into four categories: formal documents, drafts, pending publication, and recycling bin. Deleting a formal document means moving it to the recycling bin instead of physically deleting it, and the content itself is still retained in the recycling bin. Therefore, 'deletion' within the site is a reversible action, and the front-end return should be written as 'currently unavailable' rather than 'never existed'.

Hiding is a visibility setting at the category level: the article records and data retrieval paths are still there, but they no longer appear in the list and front-end. This is more like a denial of access or temporary unavailability, different from actual failure.

Draft and pending release are the same. They are explicit statuses within the site, not missing; if accessed directly via address, it should go through the preview parameters rather than a失效code, otherwise, the preview link is indistinguishable from the official address in the reader's eyes.

How do the four semantic categories within the site correspond?

The real status of the content The semantics that the front-end should provide What should not be done
Deleted and retained in the recycle bin Treated as non-existent, retaining the recoverable path Do not inadvertently make the category page invalid as well
The column is temporarily hidden Deny access or temporarily unavailable Do not give a permanent disable signal
Draft, pending release Go through the preview parameters, refuse at non-preview entry Do not share the same template with non-existent ones
Error in data retrieval or template Server error code Do not pretend that the content does not exist

Look at it carefully, what is easy to make a mistake is actually the third, fourth line: pretending to be missing when there is an error, the operation and maintenance personnel cannot see it; the preview address gives an invalid code, and the crawling party will take the content that is still being edited as a dead link.

Common questions

How to modify the site that has been unified into 404?First separate the data retrieval exception and content missing, then specify the semantics separately for classification hiding and article deletion; batch online changes, and use a batch of real addresses for regression verification after the change is complete.

Is the content deleted long ago supposed to be given a 404?For addresses with clear invalidation facts, a more certain invalidation code can be given, but it should be noted that it is more difficult to roll back than 404 and is suitable for content that is no longer recoverable.

Will the content in the recycle bin be captured?The recycle bin does not participate in the front-end list. If the address can still be accessed directly, it should be judged according to the in-site status and the corresponding semantics should be given, and it should not be allowed to become a normal readable page.

What about the content under review?Unpublished content should not be readable to anonymous visitors. This type should follow the rejection semantics while retaining the preview channel after login.

Related articles

How will the front-end sorting and push be chaotic when the scheduled publication time zone difference is taken into account

Schedule publishing so that content transitions from pending to official at the specified time. Time zone differences can cause the overall launch time to shift, which may affect the sorting of content by release time on the front end and the timing of link promotions. First, clarify the visibility scope of the three states: pending, official, and recycling bin. Then, unify the time zone standards and verify the release time together during backup and recovery.

2026-10-11

Why are all the client addresses logged in the log all proxy addresses when a proxy is hung in front of the website?

After the reverse proxy, only the proxy address remains in the log because the connection indeed comes from the proxy. The real source needs to be obtained from the forwarding header, but this header can be forged, and only the section appended by the trusted proxy should be believed when retrieving the value. This article explains the alignment of the order, trust boundaries, and the three steps on the deployment side.

2026-10-11

How to match the program port and gateway port when running the website building program in the container

Containerized deployment of website programs requires three layers of ports: program listening, container mapping, and gateway outward. This article takes the default listening port as an example to explain the corresponding relationship of the three layers, typical performance when the mapping is written incorrectly, and the request headers that need to be supplemented for reverse proxy and the items that need to be checked after deployment.

2026-10-11

Where is the backend entry of the online experience station, and which capabilities should be verified during the trial?

The information and backend entry path of the experience station are written in the documentation, and the demonstration account is in the README demonstration area. This article provides a 30-minute trial list: content model and columns, AI dialogue and toolset, skill and intent directory, access and approval, included related modules, and explain which conclusions should not be obtained from the experience station.

2026-10-11

The large attachment upload is blocked at 413, why is it not understandable in the browser?

When uploading a large attachment, it is blocked by the gateway and returns 413. Browsers often cannot display the reason because the limit is set before the request enters the application, and the program does not have time to take over. The default limit for this type of nginx is about one megabyte, which can be set by segment according to the site and location. This article explains which segment the limit controls, why the error is difficult to read, and how to check the three types of entry points for attachment upload, batch import, and interface upload.

2026-10-11

Content security policy reports first and does not block, deciding to really block after seeing what happens

Content Security Policy runs in only-report mode first, used to collect violation records without blocking execution, which is a gray-scale method before going live with intercept rules. There are two ways to write the report target, new browsers will ignore the old address, and both should be written during the compatibility period. This article explains what types of information to look at during the gray period, when to cut off the intercept, and how to avoid a blank screen when changing the template.

2026-10-11

Add integrity verification to external scripts, why do you still need to explicitly write cross-domain attributes in the tag?

When adding integrity check to external scripts, the cross-domain attribute must be explicitly written in the tag, because resources with integrity check must go through cross-domain requests, otherwise the browser will not consider the check result as available. The check value consists of an algorithm prefix plus an encoded hash, and multiple summary alternatives can be provided at the same time. This article explains where the check occurs, the format and alternatives, as well as how to batch verify reference points after template changes.

2026-10-11

How many addresses can a single sitemap file hold, and how should it be split if it exceeds the limit?

The single sitemap file has two concurrent limits: the number of addresses should not exceed 50,000, the uncompressed volume should not exceed 50MB, and any that reach the top must be split into multiple fragment files, and then a index file is used to list the fragments one by one. This article explains how to calculate the limit according to the original protocol, how to name the fragment directory stably, the division of labor between the index file and the sub-maps, as well as the pseudo-static rules and configuration to check when the background automatically generates the sitemap, to avoid bypassing the limit by trimming the number of addresses in an erroneous manner.

2026-10-12