Extension talk:ExternalRedirect


Page with external redirect is no longer editable

If I use this to make an external redirect, all trys to re-edit the page fail. Even if I type .../index.php?title=page&action=edit into the browser's adressbar, I'm instantly redirected to the page.

Any solutions for it? Trystan Damranya (talk) 11:43, 11 March 2017 (UTC)

I came here wondering the same. But the extension seems unmaintained, right? Are you still using it? Ahmad Gharbeia أحمد غربية (talk) 13:29, 13 February 2020 (UTC)
The "index.php?title=Page&action=edit" URL should work (I have tested it on MediaWiki 1.37.1 with no other extensions or customizations). This is the preferred method. The easiest way is to open another page in the editor and then change page name in the URL.
Another approach would be temporary disabling ExternalRedirect (altogether or for the specific namespace/page) in LocalSettings.php. DavisNT (talk) 20:51, 5 January 2022 (UTC)

Extension still works

Just in case anyone is wondering, this extension still works perfectly as of 2020-06-12. NottNott (talk) 20:33, 12 June 2020 (UTC)

Not working as of 1.35.1

This extension isn't working on 1.35.1, probably since the 1.35 release. 84.50.133.41 (talk) 16:34, 21 January 2021 (UTC)

As described in this thread, this is caused by a deprecated method in the extension.
Therefore, you simply have to go to ExternalRedirect/ExternalRedirect.php and edit line 55.
function wfExternalRedirectRender($parser, $url = '') {
    global $wgExternalRedirectNsIDs, $wgExternalRedirectPages, $wgExternalRedirectDeniedShowURL;
//    $parser->disableCache();
    $parser->getOutput()->updateCacheExpiry(0); //fix for wiki 1.35
    if(!wfParseUrl($url) || strpos($url, chr(13))!==false || strpos($url, chr(10))!==false) {
        return wfMessage('externalredirect-invalidurl')->text();
    }
    if(in_array($parser->getTitle()->getNamespace(), $wgExternalRedirectNsIDs, true)
      || in_array($parser->getTitle()->getPrefixedText(), $wgExternalRedirectPages, true)) {
        header('Location: '.$url);
        return wfMessage('externalredirect-text', $url)->text();
    } else {
        return wfMessage('externalredirect-denied')->text().($wgExternalRedirectDeniedShowURL
          ? ' '.wfMessage('externalredirect-denied-url', $url)->text() : "");
    }
}
Hope that helps!
Cheers Schlagmichdoch (talk) 14:32, 7 May 2021 (UTC)
ExternalRedirect v1.2.0, released on January 3 2022, supports MediaWiki 1.35+ DavisNT (talk) 20:37, 5 January 2022 (UTC)

Not working if not logged?

Is it possible that the extension only works for logged users? Or am I doing something wrong.

If I'm not logged I receive the message: 'This page redirects to an external site: '

If I'm logged it works fine. 88.5.11.9 (talk) 21:27, 24 February 2023 (UTC)

Solved: this happens if you do not create a new namespace instead using the main (0) namespace. 88.5.11.9 (talk) 07:42, 25 February 2023 (UTC)