Extension:HideReferringPage

From MediaWiki.org
Jump to: navigation, search


MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
HideReferringPage

Release status:Extension status beta

ImplementationTemplate:Extension#type Link markup
DescriptionTemplate:Extension#description Prevent external sites from knowing what pages are linking to them.
Author(s)Template:Extension#username Tony Primerano (primeranotalk)
Latest versionTemplate:Extension#version 1.0
LicenseTemplate:Extension#license GPL
Download https://code.google.com/p/hide-referring-page/downloads/list
ParametersTemplate:Extension#parameters

$wgHideReferringPageImages can be set to false to turn off the external image. This is proxy requires curl to be functional on your host. The image proxy isn't invoked if $wgAllowExternalImages is false.

Hooks usedTemplate:Extension#hook
LinkerMakeExternalLinkManual:Hooks/LinkerMakeExternalLink
LinkerMakeExternalImageManual:Hooks/LinkerMakeExternalImage

Translate the HideReferringPage extension if it is available at translatewiki.net

Check usage and version matrix.

What can this extension do?[edit]

For companies and organizations with private wikis, the title of a wiki can give sites that you link to, too much information. For example if a sysadmin at Company A noticed a referrer in their access logs from Company B titled "Potential Acquisitions" that person could use this information to trade stock, or notify management of a potential takeover.

This extension sends all external links on your wiki through a redirect page so the referring page is unknown. External images are sent through a proxy for the same reason (Image proxying can be disabled).

For the incident that led me to write this extension see my blog.  :-)

It is strongly recommended that this extension not be used on public sites. If you do hackers may leverage the redirector provided with this extension. For more information on the risks associated with redirects in the wild see this article.

Standard alternatives[edit]

As of 2016, it's possible to set a "no-referrer" policy directly from your webserver, see specifications: https://www.w3.org/TR/referrer-policy/

Usage[edit]

Once installed all external images and links will be re-written when pages are viewed so the links can be clicked without worrying about the page name being sent to the external site.

Download instructions[edit]

Download the latest tarball from https://code.google.com/p/hide-referring-page/downloads/list

Extract it in your $IP/extensions/ directory

tar -zxvf HideReferringPage.tar.gz

Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation[edit]

To install this extension, add the following to LocalSettings.php:

# Uncomment to turn off image proxy 
# $wgHideReferringPageImages=false

# Uncomment to use javascript for redirects 
# $wgHideReferringPageJs=true;

require_once("$IP/extensions/HideReferringPage/HideReferringPage.php");

Configuration parameters[edit]

Setting $wgHideReferringPageImages=false will turn off external image proxying. It is on by default.

If your wiki allows external images ($wgAllowExternalImages = true) and you find that external images are broken after installing this plugin you will need to turn off the image proxy by setting $wgHideReferringPageImages=false in LocalSettings.php

The broken images are most likely caused by your installation not having curl enabled so you will be unable to proxy images.

If $wgHideReferringPageImages is set to false and you have a link to Company B's logo on your wiki pages, they will see what page the image was on in their access logs. If this is a concern you should probably set $wgAllowExternalImages=false to prevent this (assuming $wgHideReferringPageImages=true did not work for you).


Javascript Redirect[edit]

Turn on with

$wgHideReferringPageJs=true;
require_once("$IP/extensions/HideReferringPage/HideReferringPage.php");