Of course. This is a very common issue for users of the DedeCMS (织梦CMS) system, especially after moving a site or changing its structure. A 404 error means the server cannot find the requested page, and in this case, it's your custom tags.php page.

Here’s a detailed guide on what causes this and how to fix it, from the most common solution to more advanced troubleshooting.
The Core Problem: The .htaccess File is Missing or Incorrect
The most frequent reason for a tags.php 404 error in DedeCMS is that the server's URL rewriting rules are not properly configured. DedeCMS uses a file named .htaccess (in the root directory of your website) to convert "pretty" URLs like https://yourdomain.com/tags/关键词/ into server-readable ones like https://yourdomain.com/tags.php?tag=关键词.
If this file is missing, corrupted, or not allowed to work on your server, the server will try to find a literal folder named tags and fail, returning a 404 error.
Solution 1: Create or Fix the .htaccess File (Most Likely Fix)
This is the solution for 95% of cases. You need to ensure you have a correct .htaccess file in your website's root directory (the same folder where index.php and tags.php are located).

Step 1: Check for Existing .htaccess
- Use an FTP client (like FileZilla) or your hosting control panel's file manager to navigate to your website's root directory.
- Look for a file named
.htaccess. Important: Files starting with a are hidden by default. In your FTP client, you may need to enable the "show hidden files" option.
Step 2: Create or Edit the File
If the file doesn't exist, create it. If it does exist, open it for editing.
Here is the standard DedeCMS .htaccess code. Copy and paste this into your file:
<IfModule mod_rewrite.c> RewriteEngine On # RewriteBase / <-- Uncomment and change if your site is in a subdirectory RewriteRule ^tags/(.*)$ tags.php?tag=$1 [L] RewriteRule ^category/(.*)$ category\.php\?id=$1 [L] RewriteRule ^list/(.*)$ list\.php\?tid=$1 [L] RewriteRule ^archives/([0-9]+)\.html$ archives\.php\?aid=$1 [L] RewriteRule ^archives/([0-9]+)/([0-9]+)\.html$ archives\.php\?aid=$1&pageno=$2 [L] RewriteRule ^index\.html$ index\.php [L] </IfModule>
Key Points:
RewriteEngine On: This line must be present and active.- *`RewriteRule ^tags/(.)$ tags.php?tag=$1 [L]
**: This is the most important line for your problem. It tells the server: "If a request comes in for a path that starts withtags/, redirect it totags.phpand pass the rest of the path as thetag` parameter." [L]: This means "Last rule." If this rule matches, the server will stop processing other rules.RewriteBase /: If your website is installed in a subdirectory (e.g.,https://yourdomain.com/mydede/), you must uncomment this line and change it toRewriteBase /mydede/.
Step 3: Save and Upload
Save the file and upload it to your website's root directory. Make sure the filename is exactly .htaccess (including the dot at the beginning).

Step 4: Check Server Configuration
After uploading, try accessing a tag page again. If it still doesn't work, your server might not have the Apache mod_rewrite module enabled. This is something your web hosting provider needs to enable. You can contact their support and ask them to "enable mod_rewrite for your site."
Solution 2: Check for Typos in tags.php Template
Sometimes, the problem isn't the URL rewrite but the template file that generates the tag page.
- Log in to your DedeCMS admin panel.
- Go to 模板 (Templates) -> 模板管理 (Template Management).
- Find the default template for the tag list page. It's usually named
default/list_tag.htm. - Check this file for any syntax errors, unclosed PHP tags (
<?php ... ?>), or missing variables. A simple typo here can cause the PHP script to fail, which the server might interpret as a 404. - If you recently modified this template, try reverting it to a fresh default copy to see if that fixes the issue.
Solution 3: Verify File Permissions
Incorrect file permissions can prevent the server from reading the necessary files.
- Using your FTP client, right-click on the
.htaccessfile and select File permissions. - Set the permissions to 644. This means the owner can read and write, and the group and others can only read.
- Also, check the permissions of the
tags.phpfile in your root directory. It should also be 644. - The folder containing these files (your website root) should have permissions 755.
Solution 4: Clear Your Cache
DedeCMS has its own cache. A corrupted cache file can sometimes cause strange errors.
- In your DedeCMS admin panel, go to 系统 (System) -> 系统设置 (System Settings) -> 核心设置 (Core Settings).
- Find the option for "缓存目录" (Cache Directory). It's usually
/data/cache/. - You can either manually delete all files inside this directory via FTP or look for a "一键更新缓存" (One-click Update Cache) button in the admin panel and click it.
Solution 5: Check for Conflicting Plugins or Modules
If you have installed third-party plugins, especially those related to SEO or URL rewriting, they might be conflicting with DedeCMS's native rules.
- Try disabling any recently installed SEO or URL-related plugins.
- Check if the
tags.phppage starts working again. If it does, you've found the culprit. You may need to adjust the plugin's settings or find an alternative.
Summary Checklist
If your tags.php page is showing a 404 error, follow these steps in order:
- Create or Fix
.htaccess: This is the #1 cause. Use the code provided above and place it in your website's root. - Enable
mod_rewrite: If step 1 fails, contact your host to ensure this Apache module is enabled. - Check Template File: Verify
default/list_tag.htmfor errors in the DedeCMS admin panel. - Fix Permissions: Set
.htaccessto644and your website root folder to755. - Clear Cache: Delete the contents of the
/data/cache/folder. - Disable Plugins: Temporarily turn off any SEO or URL-related plugins to check for conflicts.
By systematically going through these steps, you should be able to resolve the 404 error for your tags page.
