plugin:redirect
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:redirect [2018-05-13 03:02] – [Media redirects] Dr-Yukon | plugin:redirect [2022-11-21 00:26] (current) – Aleksandr | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
author | author | ||
email : andi@splitbrain.org | email : andi@splitbrain.org | ||
type : action, admin | type : action, admin | ||
- | lastupdate : 2017-11-05 | + | lastupdate : 2019-12-04 |
- | compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus | + | compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus, Greebo, Hogfather, Igor |
depends | depends | ||
conflicts | conflicts | ||
Line 21: | Line 21: | ||
===== Download and Installation ===== | ===== Download and Installation ===== | ||
- | Download | + | Search |
- | + | ||
- | :!: Needs php 5.6+ | + | |
===== Changes ===== | ===== Changes ===== | ||
- | [[https:// | + | [[https:// |
{{rss> | {{rss> | ||
===== Configuration/ | ===== Configuration/ | ||
- | The plugin stores a list of page/ | + | The plugin stores a list of page/ |
In order to implement the redirections manually, just place on the '' | In order to implement the redirections manually, just place on the '' | ||
Line 74: | Line 72: | ||
> 3 years later (Ponder Stibbons release) there is a menu entry on the " | > 3 years later (Ponder Stibbons release) there is a menu entry on the " | ||
+ | |||
==== Wildcard redirection ==== | ==== Wildcard redirection ==== | ||
Line 81: | Line 80: | ||
server: | server: | ||
- | The fix: | + | ===== The fix: ===== |
- | <file diff action.php.diff> | + | |
- | 37a38,53 | + | Edit //helper.php// file: |
- | > | + | |
- | > | + | Find this line: |
- | > | + | |
- | > foreach ( $redirects as $mask=> | + | <code> |
- | > { | + | if(empty($redirects[$id])) return false; |
- | > $regex_mask = '/ | + | </code> |
- | > | + | |
- | > if ( preg_match( $regex_mask, | + | Place this code **before** that line: |
- | > { | + | |
- | > $newID = preg_replace( $regex_mask, | + | <code> |
- | > break; | + | $newID = ""; |
- | > } | + | |
- | > } | + | { |
- | > | + | |
- | > $redirects[$ID] = $newID; | + | |
- | > | + | |
- | </file> | + | |
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | | ||
+ | |||
+ | </code> | ||
Note that you'll need to symlink the directories in '' | Note that you'll need to symlink the directories in '' | ||
\\ --- Michał Sacharewicz // | \\ --- Michał Sacharewicz // | ||
- | Please could someone tell me exactly, where (wich lines) i have to paste that code in or what i have to replace. Don´t understand | + | > This almost does what I need it to. I'm organizing my novel notes in dokuwiki and have it broken out into namespaces. I want to be able to quickly add %%[[character_name]]%% and have it properly link to characters: |
- | Thx. - Tobias // | + | ==== The fix for the fix - avoid redirect loops ==== |
+ | (also called the collaborated double fix) | ||
- | Paste it after 37 string $redirects = confToHash(dirname(__FILE__).'/ | + | The * Wildcard modification works quite well despite some redirect |
- | 37a38,53 mean "after 37 string, in new numbered 38-53 strings | + | |
- | > This almost does what I need it to. I'm organizing my novel notes in dokuwiki | + | To avoid redirect loops we added a second parameter '' |
+ | |||
+ | and in '' | ||
+ | |||
+ | This is a quick hack and straight forward. | ||
+ | |||
+ | In '' | ||
+ | |||
+ | add '' | ||
+ | |||
+ | to the code at the very end of the file just right before '' | ||
+ | |||
+ | In '' | ||
+ | |||
+ | find the function '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | right after or before | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | now you can do something like this (see below) which without the modification will end up in an infinite | ||
+ | |||
+ | |||
+ | '' | ||
+ | or even | ||
+ | '' | ||
+ | |||
+ | (you may have to play around a bit to get the effect.....) | ||
+ | |||
+ | Note: you cant use '' | ||
+ | |||
+ | (in the example above it's the '' | ||
+ | |||
+ | In the example above we redirect all pages start with '' | ||
+ | or all pages starting with '' | ||
+ | |||
+ | sounds a bit weird ;) - it is! | ||
+ | Best regards Volker & Lucas - 2022-03-29 | ||
==== Virtual Hostname Redirects ==== | ==== Virtual Hostname Redirects ==== | ||
Line 173: | Line 219: | ||
==== Media redirects ==== | ==== Media redirects ==== | ||
- | Please add second admin config window for media' | + | <del>Please add second admin config window for media' |
- | * page '' | + | * <del>page '' |
- | * has a syntax %%{{./header.jpg}}%% | + | * <del>has an image with syntax %%{{header.jpg}}%%</del> |
- | * (**not a %%{{/very/ | + | * < |
- | * for '' | + | * < |
- | * redirected | + | * < |
- | * in '' | + | |
+ | Rewrited by root .htaccess with such rules (only for 2-letter folders!): | ||
+ | '' | ||
+ | RewriteRule ^_media/ | ||
+ | KISS principle as is. |
plugin/redirect.1526173320.txt.gz · Last modified: 2018-05-13 03:02 by Dr-Yukon