Clean URLs is a free phpBB extension by ButtonPusher that replaces long standard phpBB URLs with short, stable and readable URLs.
The extension keeps URLs compact while preserving normal phpBB functionality. Instead of exposing long query strings such as viewtopic.php?f=5&t=123, Clean URLs generates simple ID-based addresses.
Support and discussion on phpBB.com: Clean URLs extension topic.
Features
- Short URLs for topics, forums, posts, user profiles, member lists, search pages and online-user pages.
- Stable ID-based URLs that do not depend on topic or forum titles.
- Clean pagination URLs for topics, forums, member lists and other supported pages.
- Administration Control Panel settings page.
- Customizable URL patterns for supported routes.
- Support for placeholders such as
[ID],[START]and[CHAR]. - Configurable topic URL format, for example
t[ID]ortopic[ID]. - Configurable forum URL format, for example
forum-[ID]orf[ID]. - Configurable direct post URL format, for example
p[ID]orpost[ID]. - Choice between direct post URLs and SEO-friendly topic-based post links.
- Optimized SEO-friendly post-link generation with reduced database load.
- Dynamic Apache/LiteSpeed and nginx rewrite rules generated from the current URL settings.
- Reset-to-defaults option in the Administration Control Panel.
- Clean links in phpBB-generated HTML.
- Support for direct post links and post anchors.
- Clean URLs in sitemap locations.
- Redirects from supported standard phpBB URLs.
- Preserves session IDs and required query parameters where necessary.
- Works with phpBB installed in the domain root or in a subdirectory such as
/forum/. - No phpBB core file modifications required.
- Apache, LiteSpeed and nginx support.
- Multiple language packs included.
Screenshot
URL examples
With the default settings, Clean URLs uses compact routes such as:
/t123– topic/t123-20– paginated topic/forum-5– forum/forum-5-25– paginated forum/p456– direct post URL/memberlist-50– paginated member list/memberlist-a– member list filtered by first character/profile-17– user profile/team– team page/newposts– new posts search/unanswered– unanswered topics/activetopics– active topics/viewonline– online users/login– login page/register– registration page
A link to a specific post can use a direct URL such as /p456#p456 or, when the SEO-friendly post-link mode is enabled, a topic-based URL such as /t123#p456.
URL patterns can be changed in the Administration Control Panel. For example, t[ID] can be changed to topic[ID], and p[ID] can be changed to post[ID].
Requirements
- phpBB 3.3.x
- PHP 7.2 or newer
- Apache or LiteSpeed with
mod_rewrite, or nginx - Permission to edit
.htaccessor the nginx server configuration
Installation
- Download the extension archive.
- Extract it to your phpBB installation so that the extension files are located in:
ext/buttonpusher/cleanurls/ - For Apache or LiteSpeed, open the file:
ext/buttonpusher/cleanurls/docs/apache-rules.txt
The same Apache/LiteSpeed rewrite rules are also available on the Clean URLs settings page in the Administration Control Panel. - Copy the rewrite rules into the
.htaccessfile of your phpBB installation immediately after the line:
RewriteEngine on - If phpBB is installed in a subdirectory, for example
/forum/, edit the.htaccessfile located inside that phpBB directory. - For nginx, use the nginx rewrite rules included with the extension or copy them from the Clean URLs settings page in the Administration Control Panel.
- Save the web server configuration.
- Open the phpBB Administration Control Panel.
- Go to Customise → Manage extensions.
- Find Clean URLs and click Enable.
- Open the Clean URLs settings page in the Administration Control Panel.
- Review the URL patterns and post-link mode.
- If you change any URL patterns from their default values, copy the newly generated Apache/LiteSpeed or nginx rewrite rules from the Clean URLs settings page and update your server configuration accordingly.
- Clear the phpBB cache.
Apache and LiteSpeed
For Apache and LiteSpeed, the default rewrite rules are included in:
ext/buttonpusher/cleanurls/docs/apache-rules.txt
The same rules are also displayed on the Clean URLs settings page in the Administration Control Panel, so they can be copied directly from there.
Copy the rules into the phpBB .htaccess file immediately after:
RewriteEngine on
If phpBB is installed in a subdirectory such as /forum/, edit the .htaccess file inside that phpBB directory.
If you change any URL patterns in the Clean URLs settings page, use the updated Apache/LiteSpeed rules generated there instead of the default rules from apache-rules.txt.
No phpBB core files need to be edited.
nginx
nginx does not use .htaccess. The extension includes ready-made nginx rewrite rules for the default URL configuration.
The nginx rules are also displayed on the Clean URLs settings page in the Administration Control Panel, where they can be copied directly.
If you change any URL patterns, the nginx rules generated on the settings page are updated accordingly.
Add the rules to the server block that handles your phpBB installation, reload nginx, and clear the phpBB cache.
URL settings
Clean URLs 1.0.2 includes an Administration Control Panel settings page where supported URL patterns can be customized.
Examples include:
t[ID]ortopic[ID]for topicsforum-[ID]orf[ID]for forumsp[ID]orpost[ID]for direct post URLsprofile-[ID]for user profilesmemberlist-[START]for member-list pagination
Required placeholders must remain present in URL patterns. For example, a topic route must contain [ID].
Whenever a URL pattern is changed, the extension generates matching Apache/LiteSpeed and nginx rewrite rules on the same settings page.
Post link modes
Clean URLs provides two modes for links to individual posts.
The direct-post mode uses links such as:
/p456#p456
This is the more compatible option because the post ID remains sufficient to locate the post even if the post is later moved to another topic.
The SEO-friendly topic-based mode uses links such as:
/t123#p456
This produces a cleaner topic-based address, but a link may become less reliable if the post is moved to another topic.
Version 1.0.2 optimizes SEO-friendly post-link generation and removes unnecessary per-link database lookups that could cause excessive server load and HTTP 503 errors on some pages.
The examples shown in the Administration Control Panel automatically follow the configured topic and direct-post URL patterns.
No phpBB core modifications
Clean URLs works as a normal phpBB extension and does not require editing phpBB core PHP files or templates.
The only server-side configuration required is the URL rewriting setup for Apache, LiteSpeed or nginx.
Disabling or removing the extension
If you disable Clean URLs, phpBB returns to its standard URL format. Forum, topic, post and user IDs are not changed.
If you remove the extension permanently, also remove the rewrite rules that were added to .htaccess or to the nginx configuration.
Changelog
1.0.2
- Fixed HTTP 503 errors that could occur on some pages when SEO-friendly post links were enabled.
- Optimized generation of SEO-friendly topic-based post URLs.
- Removed unnecessary per-link database lookups during page generation.
- Reduced database load on pages containing multiple post links.
- Improved handling of last-post links on the forum index and forum pages.
- Improved compatibility with phpBB 3.3.x topic and post counters.
- Preserved SEO-friendly topic URLs and post anchors while avoiding the excessive-query issue.
1.0.1
- Added an Administration Control Panel settings page.
- Added configurable URL patterns for topics, forums, posts, profiles, member lists, search pages, online-user pages, login, registration and other supported phpBB routes.
- Added support for custom route patterns using placeholders such as
[ID],[START]and[CHAR]. - Added a choice between direct post URLs and SEO-friendly topic-based post URLs.
- Added dynamically generated Apache/LiteSpeed and nginx rewrite rules in the ACP.
- Added a reset-to-defaults option for Clean URLs settings.
- Fixed member-list pagination URLs such as
/memberlist-100. - Fixed topic pagination URLs such as
/t3256-20. - Fixed forum and alphabetical member-list pagination handling.
- Fixed duplicate post anchors such as
#p18764#p18764. - Improved compatibility of direct post links.
- Preserved support for all included language packs.
1.0.0
- Initial public release.
- Added clean URLs for topics, forums, posts, profiles, member lists, search pages and online-user pages.
- Added Apache/LiteSpeed and nginx rewrite rules.
- Added support for phpBB installations in the domain root and in subdirectories.
Download
Current version: 1.0.2
Comments (0)