Redirect visitors to a configurable fallback URL whenever they hit a non-existent short URL or the YOURLS root page.
Valid short URLs continue to work normally — no interference with your existing links.
- Automatic fallback redirect for unknown short URL keywords and the YOURLS root page
- Choice of redirect type: 301 Permanent or 302 Temporary
- Stats pages respected: URLs ending with
+are passed through only when the keyword actually exists; unknownkeyword+requests are redirected to the fallback like any other unknown keyword - AlternativeIndex compatible: when YOURLS AlternativeIndex is active, root page interception is automatically disabled — both plugins coexist without conflicts, and the admin page shows a compatibility notice
- Instant disable: leave the fallback URL empty to restore default YOURLS behavior
- Update notifications: checks GitHub for new releases and shows a badge in the admin panel
- Modular structure: split into
inc/modules and staticassets/, no composer, no npm, no build step
- Download the plugin from the latest release.
- Unzip the contents into the
user/plugins/url-fallback/directory. - Activate the plugin in the YOURLS admin panel under Plugins.
- Go to Plugins → URL Fallback and enter the destination URL.
Requires YOURLS 1.9+ and PHP 7.4+
- Open the URL Fallback settings page from the Plugins menu.
- Enter the Fallback URL — the destination visitors are sent to when no matching short URL is found.
- Choose the Redirect Type:
- 302 Temporary — use this while testing or when the destination may change.
- 301 Permanent — use this once the destination is stable. Browsers cache 301 redirects, so switching later requires visitors to clear their cache.
- Click Save Settings.
| Visitor request | Result |
|---|---|
Valid short URL (e.g. /abc) |
YOURLS handles it normally |
Unknown keyword (e.g. /xyz) |
Redirected to fallback URL |
YOURLS root page (/) |
Redirected to fallback URL |
YOURLS root page (/) with AlternativeIndex active |
AlternativeIndex handles it |
Stats page of existing keyword (e.g. /abc+) |
YOURLS handles it normally |
Stats page of unknown keyword (e.g. /xyz+) |
Redirected to fallback URL |
| No fallback URL configured | Default YOURLS behavior (404 page) |
Clear the Fallback URL field and save. The plugin stays active but does not intercept any requests.
| Option key | Type | Notes |
|---|---|---|
url_fallback_url |
string | Full URL including scheme; empty string = disabled |
url_fallback_redirect_type |
int | 301 or 302; defaults to 302 if not set |
This plugin is ready for internationalization via .po/.mo files inside the languages/ folder.
Available languages:
- 🇬🇧 English (default)
Contributions for additional languages are welcome.
This plugin is licensed under the MIT License.
Lovingly developed by the usually-on-vacation brain cell of Gioxx.
Pull requests and feature suggestions are welcome!
If you find bugs or have feature requests, open an issue.
If you find it useful, leave a ⭐ on GitHub! ❤️