discuz dynamic url 301 redirect jumps to pseudo-static url method

Today, I met a friend who works on a forum. When discussing SEO, he said that his website was included with many dynamic URLs.
I took a rough look and useddiscuzAlthough the forum program has been set to pseudo-static, it still includes many original dynamic links, so I thought of using the 301 redirect method to redirect dynamic URLs to pseudo-static URLs. At first, I felt a little dizzy and felt like I was jumping around in an endless cycle. I checked the relevant information. I have found a solution and share it here with friends in need. I believe many friends will need this.
This is a basic modification that suits the original link
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html$ forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=$2[L]
RewriteCond %{QUERY_STRING} ^mod=viewthread&tid=([0-9]+)&extra=page%3D([0-9]+)&page=([0-9]+)$ [NC]
RewriteRule ^forum.php$/thread-%1-%2-%3.html? [L,R=301]
RewriteRule ^forum-(w+)-([0-9]+).html$/forum.php?mod=forumdisplay&fid=$1&page=%2[L]
RewriteCond %{QUERY_STRING} ^mod=forumdisplay&fid=([0-9]+)&page=([0-9]+)$ [NC]
RewriteRule ^forum.php$/forum-%1-%2.html? [L,R=301]
However, since the links included by search engines are generally not the default, they will be streamlined and summarized as follows, but it is not guaranteed to be suitable for everyone. It is recommended to transform them through the original links above.
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html$ forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=$2[L]
RewriteCond %{QUERY_STRING} ^mod=viewthread&tid=([0-9]+)$ [NC]
RewriteRule ^forum.php$/thread-%1-1-1.html? [L,R=301]
RewriteRule ^forum-(w+)-([0-9]+).html$/forum.php?mod=forumdisplay&fid=$1&page=%2[L]
RewriteCond %{QUERY_STRING} ^mod=forumdisplay&fid=([0-9]+)$ [NC]
RewriteRule ^forum.php$/forum-%1-1.html? [L,R=301]
© Website copyright and disclaimer
1.[honmau Media] independently owns the copyright of all materials on relevant pages of this website;
2. No one is allowed to copy it without the express written permission of [honmau Media];
3. The articles that do not indicate "honmau Media" on this website are all from the Internet and are only for everyone to learn and refer;
4. If there is any infringement/violation/irregularity, please contact customer service QQ or email to delete it, please understand;
5.[honmau Media] reserves the right to correct, modify and update this statement at any time.legal notice