_BuTToN_PuSHeR_

Clean URLs for phpBB 3.3.x

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] or topic[ID].
  • Configurable forum URL format, for example forum-[ID] or f[ID].
  • Configurable direct post URL format, for example p[ID] or post[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.
  • Correct topic-based URLs when opening the first unread post from phpBB email notifications.
  • Correct moderation approval links for pending topics and replies, including clean return URLs after approval.
  • Clean URLs in sitemap locations.
  • Redirects from supported standard phpBB URLs.
  • Removes session IDs from public board URLs in SEO-friendly mode while preserving required query parameters.
  • Preserves native session handling in compatible mode and security session IDs for administration and logout.
  • 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

ButtonPusher Clean URLs

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 .htaccess or the nginx server configuration

Installation

  1. Download the extension archive.
  2. Extract it to your phpBB installation so that the extension files are located in:
    ext/buttonpusher/cleanurls/
  3. 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.
  4. Copy the rewrite rules into the .htaccess file of your phpBB installation immediately after the line:
    RewriteEngine on
  5. If phpBB is installed in a subdirectory, for example /forum/, edit the .htaccess file located inside that phpBB directory.
  6. 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.
  7. Save the web server configuration.
  8. Open the phpBB Administration Control Panel.
  9. Go to Customise → Manage extensions.
  10. Find Clean URLs and click Enable.
  11. Open the Clean URLs settings page in the Administration Control Panel.
  12. Review the URL patterns and post-link mode.
  13. 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.
  14. 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.3 includes an Administration Control Panel settings page where supported URL patterns can be customized.

Examples include:

  • t[ID] or topic[ID] for topics
  • forum-[ID] or f[ID] for forums
  • p[ID] or post[ID] for direct post URLs
  • profile-[ID] for user profiles
  • memberlist-[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.

In version 1.0.3, direct post links such as /p456#p456 redirect in SEO-friendly mode to the corresponding topic and post anchor, for example /t123#p456. If the post is on a later page, the target includes the correct page offset, such as /t123-20#p456. Custom URL patterns and phpBB installations in subdirectories are supported.

Version 1.0.7 fixes first-unread post links opened from phpBB notification emails. In SEO-friendly mode, a link such as /t123?e=1&view=unread#unread now resolves to the topic-based post URL, for example /t123#p456 or /t123-20#p456 on a later page, rather than leaving a direct post URL such as /p456#p456 in the browser address bar.

Version 1.0.6 fixes approval links for posts awaiting moderation. When an administrator approves the first post of a new topic, the return URL now points to the clean topic address, such as /t123, instead of a malformed address such as /t123&p=456#p456. Approval links for later replies retain the appropriate post destination, including topic pagination and configured URL patterns.

After creating a topic or editing its first approved post, the return link leads to the clean topic URL. Saving a reply or editing another post returns the user to that specific post, with the appropriate page offset and a single post anchor.

SEO-friendly mode removes sid from public board URLs and uses cookies to maintain logged-in sessions. Cookies must therefore be enabled and the board's cookie settings must be correct. Administration Control Panel URLs and logout links retain the security session IDs required by phpBB. Compatible mode keeps native session-ID handling.

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.7

  • Fixed first-unread post links opened from phpBB email notifications in SEO-friendly mode. URLs such as /t123?e=1&view=unread#unread now resolve to clean topic-based post URLs such as /t123#p456, rather than ending at /p456#p456.
  • Corrected the U_MINI_POST URL used by phpBB's unread-post anchor and JavaScript address-bar update.
  • Preserved topic pagination, custom topic URL patterns, existing direct-post links and moderation approval redirects.
  • No changes required to Apache/LiteSpeed or nginx rewrite rules, extension settings, or phpBB core files.

1.0.6

  • Fixed malformed MCP approval redirects when phpBB appended &p=POST_ID#pPOST_ID to an already-clean topic URL and placed the result in the encoded redirect parameter.
  • After approving the first post of a pending topic, the administrator is returned to the clean topic URL, for example /t123, instead of /t123&p=456#p456.
  • Preserved post-specific destinations when approving later replies, including pagination, selected post-link mode and custom URL patterns.
  • Kept other MCP actions, valid redirects, confirmation tokens and security-sensitive parameters unchanged.

Existing working Apache/LiteSpeed and nginx rewrite rules do not need to be changed when updating from 1.0.5 to 1.0.6.

1.0.5

  • Fixed incorrect redirects after moving a topic to another forum using phpBB quick moderation. The browser now opens the clean topic URL, such as /t123, instead of a malformed URL such as /.%2Ft123.
  • Prevented double URL encoding of the redirect parameter already encoded by phpBB.
  • Preserved encoded redirect query parameters and plus-sign handling without affecting custom URL patterns or other URL parameters.

Existing working Apache/LiteSpeed and nginx rewrite rules do not need to be changed when updating from 1.0.4 to 1.0.5.

1.0.4

  • Preserved the explicit t=TOPIC_ID when third-party extensions generate last-post links containing both t=TOPIC_ID and p=POST_ID.
  • Improved compatibility with Precise Similar Topics 1.8.0 and RH Topic Tags 3.0.0 by keeping these links in canonical topic form, such as t123#p456, instead of reducing them to p456#p456.
  • Fixed search-result links with hilit so URLs such as viewtopic.php?t=123&hilit=... are converted to t123?hilit=... while preserving the search highlight.

Existing working Apache/LiteSpeed and nginx rewrite rules do not need to be changed when updating from 1.0.3 to 1.0.4.

1.0.3

  • Removed session IDs from public board URLs in SEO-friendly mode, including navigation links, posting forms and redirect targets.
  • Preserved security session IDs for the Administration Control Panel and logout, along with native session handling in compatible mode.
  • Fixed duplicate post anchors such as #p456#p456 in links and redirects after saving posts.
  • Fixed the return URL after creating a topic or editing its first approved post so that it leads to the clean topic address.
  • Fixed returning to a saved reply or an edited non-first post, including posts on later topic pages.
  • Fixed redirects from direct post URLs such as /p456#p456 to the corresponding topic URL, page offset and post anchor in SEO-friendly mode.
  • Preserved existing topic-page offsets when processing clean post links.
  • Improved direct-post redirect handling for custom URL patterns and forums installed in subdirectories.
  • Fixed relative ACP navigation links by excluding administrative requests from URL rewriting and session-ID removal.

Existing working Apache/LiteSpeed and nginx rewrite rules do not need to be changed when updating from 1.0.2 to 1.0.3.

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-50.
  • Fixed topic pagination URLs such as /t123-20.
  • Fixed forum and alphabetical member-list pagination handling.
  • Fixed duplicate post anchors such as #p456#p456.
  • 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

Download Clean URLs 1.0.7

Current version: 1.0.7

Comments (0)

Kherson TOP