Throw your custom 404 Not Found page instead of redirecting to index for missing links on YOURLS https://git.drg.one/YOURLS/404/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
c? cb262d5dbd added preset for smartpreview to loader_failed example 2 years ago
LICENSE Initial commit 4 years ago
README.md everything changes 2 years ago
extend_loader_failed.php.example added preset for smartpreview to loader_failed example 2 years ago
plugin.php everything changes 2 years ago

README.md

404 Not Found for YOURLS

This plugin will throw the 404 header and serve the contents of user/404.html for shorturls that don’t exist.

This is forked and modified from https://github.com/1Conan/404-redirect-YOURLS to better suit the use on drg.li

Installation

  1. Clone this repository into your plugins directory using git clone https://github.com/drgli/404-redirect-yourls.git 404
  2. Create the 404.html file in the user directory of your YOURLS install and add the contents of your custom 404 error page.

Fixing other plugins

If you enable other plugins that trigger custom actions (like QR plugins and link information plugins) you may see 404 errors instead of the page when trying to use those plugins. To fix this, copy the extend_loader_failed.php.example to extend_loader_failed.php in the user directory of your YOURLS install and copy the yourls_add_action( 'loader_failed', '...' ) line from the plugin.php of the plugin in question into that file.

License

Released under the MIT License.