Understanding duplicate URLs, canonical links and permanent redirects in phpBB SEO Framework Lite
A single phpBB page can sometimes be reached through more than one URL.
phpBB SEO Framework Lite uses canonical URLs and 301 redirects to help keep one clear, preferred public URL for each supported resource.
This guide explains how they work and why they are important.
1. The Problem: One Page, Multiple URLs
A phpBB topic may originally be available as:
Code: Select all
viewtopic.php?t=123Code: Select all
/topic/how-to-install-phpbb-seo-123/Without proper handling, search engines may discover multiple URLs for the same content.
The goal:
Use one preferred public URL consistently.
2. What Is a Canonical URL?
A canonical URL tells search engines which URL represents the preferred version of a page.
For example:
Code: Select all
<link rel="canonical" href="https://example.com/topic/how-to-install-phpbb-seo-123/" />Code: Select all
This is the preferred URL for this topic.Why is this useful?
It helps search engines understand which URL should represent the content when multiple URL variants exist.
3. What Is a 301 Redirect?
A 301 redirect is different from a canonical tag.
A 301 redirect actually sends the visitor from one URL to another.
Example:
Code: Select all
viewtopic.php?t=123
β
301 Redirect
β
/topic/how-to-install-phpbb-seo-123/4. Canonical vs 301 Redirect
They have different jobs.
Canonical:
Code: Select all
Tells search engines which URL is preferred.301 Redirect:
Code: Select all
Actually redirects the browser or crawler to another URL.A simple way to remember:
Code: Select all
Canonical = Preferred URL
301 = Permanent Move5. Native phpBB URLs
phpBB naturally uses URLs such as:
Code: Select all
viewtopic.php?t=123Code: Select all
viewforum.php?f=5Code: Select all
/topic/example-topic-123/Code: Select all
/forum/example-forum-5/They are part of phpBB's normal routing system.
The important point is to establish one consistent public URL for indexing and sharing.
6. Example: Topic URL
Suppose we have:
Topic ID:
Code: Select all
123Code: Select all
How to Configure phpBB SEOCode: Select all
viewtopic.php?t=123Code: Select all
/topic/how-to-configure-phpbb-seo-123/A request to the old/native URL can then be redirected to it.
7. Example: Forum URL
The same concept applies to forums.
Native:
Code: Select all
viewforum.php?f=5Code: Select all
/forum/installation-configuration-5/8. What Happens When a Topic Title Changes?
This is an important situation.
Imagine the original title is:
Code: Select all
phpBB SEO InstallationCode: Select all
/topic/phpbb-seo-installation-123/Code: Select all
Complete phpBB SEO Installation GuideCode: Select all
/topic/complete-phpbb-seo-installation-guide-123/The old URL should not simply become useless.
9. Historical Slugs
phpBB SEO Framework includes persistent slug infrastructure that allows previous URL identities to be recognized.
Conceptually:
Code: Select all
/topic/phpbb-seo-installation-123/
β
301 Redirect
β
/topic/complete-phpbb-seo-installation-guide-123/Only its preferred URL has changed.
Why is this important?
Old links can continue reaching the correct content instead of unnecessarily returning a 404.
10. What If Someone Uses the Wrong Slug?
The resource ID provides a stable identity.
For example, the current topic might be:
Code: Select all
/topic/complete-installation-guide-123/Code: Select all
/topic/old-installation-title-123/Code: Select all
12311. Why Keep the Resource ID in the URL?
Consider two topics:
Code: Select all
Installation GuideCode: Select all
Installation GuideBut their IDs are different:
Code: Select all
/topic/installation-guide-123/Code: Select all
/topic/installation-guide-456/This also makes URL resolution more reliable when titles or slugs change.
12. Redirects Should Preserve Important URL Information
Some URLs contain additional information that must remain useful after rewriting.
For example, a link to a specific post:
Code: Select all
viewtopic.php?t=123&p=456#p456Code: Select all
/topic/example-topic-123/#p456Code: Select all
#p456SEO rewriting should not unnecessarily break this behavior.
13. Pagination Must Also Remain Correct
A multi-page topic may have:
Code: Select all
/topic/example-topic-123/Code: Select all
/topic/example-topic-123/page/2/Code: Select all
/topic/example-topic-123/page/3/14. Avoid Redirect Chains
A redirect chain happens when several redirects are required before reaching the final URL.
For example:
Code: Select all
URL A
β
URL B
β
URL C
β
Final URLCode: Select all
Old URL
β
Final Canonical URL15. Avoid Redirect Loops
A redirect loop is a serious configuration problem.
Example:
Code: Select all
URL A β URL B
URL B β URL AIf you see:
Code: Select all
Too Many RedirectsCode: Select all
ERR_TOO_MANY_REDIRECTS16. HTTPS and Domain Consistency
Your canonical URLs should use the real public version of your website.
For example, if your website uses:
Code: Select all
https://www.example.com/Code: Select all
http://example.com/Check your phpBB board URL and server configuration if the wrong host, scheme or path appears in canonical URLs.
17. phpBB Installed in a Subdirectory
If phpBB is installed under:
Code: Select all
https://example.com/forum/Example:
Code: Select all
https://example.com/forum/topic/example-topic-123/Code: Select all
https://example.com/topic/example-topic-123/You should not manually add web-server redirect rules for thousands of phpBB topics.
For example, do not create one .htaccess rule for every topic:
Code: Select all
topic-1 β new-topic-1
topic-2 β new-topic-2
topic-3 β new-topic-3
...Manual rules should only be used when there is a specific migration or server-level requirement.
Suppose your indexed URLs currently use:
Code: Select all
/topic/example-topic-123/Code: Select all
/threads/example-topic-123/Changing them again later creates even more complexity.
Best practice:
Choose a good structure and keep it stable.
20. How to Test Canonical URLs
Open a public topic.
Use:
View Page Source
Search for:
Code: Select all
rel="canonical"Code: Select all
<link rel="canonical" href="https://example.com/topic/example-topic-123/" />21. How to Test a 301 Redirect
Take a native phpBB URL:
Code: Select all
https://example.com/viewtopic.php?t=123If canonical redirection is enabled and applicable, it should reach:
Code: Select all
https://example.com/topic/example-topic-123/22. Test a Changed Topic Title
For testing, you can use a temporary topic.
Original title:
Code: Select all
SEO Test TopicThen rename it to:
Code: Select all
SEO Redirect Test TopicThen test the previous URL.
The old URL should resolve according to the Framework's historical slug and redirect behavior rather than becoming an unrelated page.
23. Canonical URLs and XML Sitemap
Your sitemap and canonical system should agree.
If the canonical URL is:
Code: Select all
https://example.com/topic/example-topic-123/It should not intentionally promote a competing native URL:
Code: Select all
https://example.com/viewtopic.php?t=12324. Common Problems
Problem: Native URL works but SEO URL returns 404
This is usually not a canonical tag problem.
Check the web-server rewrite configuration.
Problem: Old slug returns 404
Check that the resource still exists and that slug/redirect handling is operating correctly.
Problem: Redirect goes to the wrong page
Check the resource ID, board path and permalink configuration.
Problem: Redirect removes the post anchor
Verify that the final URL preserves the expected:
Code: Select all
#pXXXProblem: Page 2 redirects to page 1
Check pagination routing and make sure pagination information is being preserved.
Problem: Canonical URL contains the wrong domain
Check phpBB's board/server configuration and any proxy/CDN configuration.
25. Recommended Configuration
For most phpBB communities:
26. A Simple Way to Remember It
301 sends the old URL to the preferred URL.
The resource ID keeps the content identity stable.
The slug keeps the URL readable.
Together, they help maintain a clean and stable URL structure.