Download the PHP package andrexdd/tombstone without Composer
On this page you can find all versions of the php package andrexdd/tombstone. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package tombstone
Tombstone
A Flarum extension. When a discussion is permanently deleted, its URL stops being a dead end.
The problem
Flarum has no memory of a discussion once it's permanently deleted. Every link to it — indexed by Google, shared on social media, bookmarked by a user, posted on another forum — turns into a bare, unexplained 404. Search engines keep crawling it, lose confidence in the domain, and eventually drop it from the index. Visitors who followed a real link just see a wall.
This has been asked for on the official Flarum forum for years. FriendsOfFlarum/merge-discussions solved it for merged discussions. Nothing solved it for deleted ones — until now.
What it does
- Zero configuration. The moment this extension is installed, every discussion deletion is automatically recorded: its title, who deleted it, and when. You don't have to do anything.
- A proper
410 Gone, not a404 Not Found. These are not the same thing to a search engine.410tells Google "this is gone on purpose, stop indexing it" — it clears faster and doesn't hurt your domain's crawl budget the way an unexplained404does. Visitors get a clean, readable page instead of a blank error. - Optional permanent redirects. If the content moved somewhere else, point the old URL at the new one with one command. From then on it's a real
301 Moved Permanently, transparently, for both browsers and search engines. - Covers both surfaces. The forum page (
/d/123-my-topic) and the API endpoint (/api/discussions/123) are both handled, so this works correctly whether a human, a crawler, or another application is the one hitting the old link. - No JavaScript, no admin panel, no front-end footprint. This is a pure backend extension. It costs nothing on pages that work normally: it only does anything at all when Flarum itself would have returned a
404.
Installation
Usage
Nothing to configure. Delete a discussion the way you always have; it's tombstoned automatically.
To point an old discussion at a new destination:
To see everything currently tracked:
To stop tracking a discussion and go back to a plain 404 for it:
If a discussion was deleted before you installed this extension and you want to redirect its old link anyway, add --force:
How it works
Flarum's own Discussion model dispatches a Flarum\Discussion\Event\Deleted event the instant a discussion row is actually deleted (as opposed to merely hidden). This extension listens for that event and writes a tiny, indexed record — nothing more than the ID, title, timestamp, and whoever did the deleting.
A single PSR-15 middleware is added to both the forum and api pipelines. It lets every request pass through completely untouched, and only inspects the outgoing response if Flarum itself decided to answer with a 404. At that point, and only at that point, it checks the discussion ID in the URL against the tombstone table. If there's a match, it swaps in either a 301 to the redirect you configured, or a properly-worded 410 Gone. Everything else — every page that isn't a 404 for a deleted discussion — is unaffected and pays no performance cost whatsoever.
Because IDs are never reused by the database once a discussion is deleted, there is no ambiguity and no risk of a tombstone ever shadowing a real, later discussion.
Compatibility
Requires flarum/core: ^2.0.0 and PHP ^8.2. No other extension is required.
License
MIT. See LICENSE.
Developed by andre.