After enabling pseudo-static, the links with query parameters jump to the wrong page, which URLs should be tested before going online?
After enabling URL rewriting with query parameters, there are jump exceptions in the address. Before going online, which URLs should be tested? The five essential ones are: links with query parameters, list pagination, tag pages, Chinese paths, and relative addresses under subdirectory deployment. URL rewriting changes the entry point of address parsing, and rules written too broadly may block normal dynamic parameter requests, which can be seen in the update logs of third-party open-source systems. This indicates that it belongs to the configuration stage and is a pitfall that is not easily discovered by the front-end.
Which layer does URL rewriting change?
The pseudo-static transformation of the 'real address with parameters' into a 'parameterless static form address', which is resolved back to the original address when accessed, and at the same time, the links in the front-end output are rewritten into a new form. It affects two places: entry parsing and link generation, so the verification also needs to be done separately at both places: whether the direct access form address can be hit, and whether the links generated in the text and navigation are the expected form.
The common form of misdirection is that the jump rule treats requests with question mark parameters as addresses that need to be normalized, resulting in the functions of filtering, searching, and pagination that depend on parameters all returning to the first page or causing jump errors. The official update log of PbootCMS recorded in V3.2.15 is just such a fix: under the static mode, the entry jump misdirection of addresses containing query parameters was removed, and the blocking of normal links containing question mark parameters was subsequently removed; on the same page, you can also see V2.0.2 fixing tag address errors and V1.3.9 adding Chinese path deployment detection.
Five types of links to be tested before going online
| Test category | Construction method | Expected result |
|---|---|---|
| With query parameters | Add a parameter combination for category filtering and in-site search | Parameters take effect and are not rewritten to a parameterless address |
| List pagination | Continuously flip to more than two screens from the first page | Page number address is stable, does not repeat back to the home page |
| Tab page | Retrieve tags containing Chinese characters and spaces | Address encoding is correct and can hit the corresponding list |
| Chinese path | Directory or file name contains Chinese characters | Access and generated links are consistent, no dead links |
| Subdirectory deployment | Website installed in a non-root directory | Relative address does not jump out of the subdirectory, rules do not hurt |
Five types need to leave a baseline record before enabling pseudo-static, test the same batch of addresses once before and after switching, compare the returned status and the final landing address, just looking at 'The page can be opened' is not enough to discover jump exceptions.
The configuration order of custom rules and rollback
AnQiCMS supports static URL and custom static rule management, the configuration order is recommended to be from small to large impact: first enable it on a single content model or a single category, confirm that there are no dead links in the front-end links and the five types of test addresses, and then expand to the entire site.
The rollback method should be set before enabling: the previous version's content should be retained when rules change, and after disabling, it is necessary to confirm whether the front-end link generation returns to its original form, to avoid leaving a semi-offline state with 'Address form changed, rules disabled'. The batch checking and correction of address forms across the entire site can be done using the global replacement tool, and then check the navigation and existing links after the change is made.
Which one to check first when 301 redirect and jump are enabled simultaneously?
When both static and 301 redirect take effect at the same time, fix the entry first and then arrange the redirect chain. The sequence is: confirm which of the new and old address forms should be used as the standard address for external use, then set the 301 redirect target for the other one, and finally check if there is a loop or multiple redirects in the redirect chain.
AnQiCMS's SEO-related capabilities are provided as a package in the same backend, including static redirection, 301 redirects, automatic generation of site maps, and search engine link submission. It is also necessary to confirm that the robots configuration has not blocked the new address format from being crawled. After enabling static redirection, the site map should be regenerated and submitted to keep the address used by the index side in the same form as the front-end links. Otherwise, the collection and internal links will diverge over a long period of time.
Common questions
Question: Why is everything normal in the backend but the front-end links are abnormal? What's the problem?Answer: It's mostly due to the inconsistency between the link generation side and the parsing side. Check if the address form generated by the template is generated by the same set of rules, and clear the cache if necessary to output and test again.
Question: Should the search feature page participate in pseudo-static?Answer: It is recommended to retain the original form with parameters. It is easy to cause duplicate content and parameters to be intercepted when making unstable addresses such as search and filtering into static forms.
Question: After going online, what is the fastest way to deal with some addresses jumping to the wrong place?Answer: First rollback the rules to the previous version, then use 301 redirect to unify the abnormal forms that have been spread out to point to the correct address, restore and regenerate the site map and submit.