Daily Fail

30th August 2018

Image Credit: dailyfail.net

How to avoid accidentally clicking Daily Mail articles

I had forgotten that I had set this up a while ago, but I accidentally clicked on a link to an article in the Daily Mail newspaper. For those who are not familiar with its style, https://rationalwiki.org/wiki/Daily_Mail describes it as:

The Daily Mail (a.k.a., Hate Mail, Daily Fail, Daily Heil, Daily Moan, Crazy Mail and so on) is a reactionary right-wing tabloid rag masquerading as a "traditional values", middle-class newspaper that is, in many ways, the second-worst of the British gutter press (only Rupert Murdoch's Sun is worse). Its weighty Sunday counterpart is the Mail on Sunday. In the 1930s, the Daily Mail infamously supported Oswald Mosley and fascism.

As you might imagine, it is not a website I would want to read accidentally, and since any visit to their website may incur advertising revenue to the organisation, I might also wish to avoid that side-effect of an accidental mouse-click.

Of course, you can apply this principle to any domain you (dis)like.

This simple setup for a Linux PC with an Apache HTTPd server will block you from accidentally visiting the Daily Mail website.

Step 1: Create a blocker page

# mkdir -p /var/www/html/dailymail
# echo "Warning: You clicked on a Daily Mail link." \
  > /var/www/html/dailymail/index.html

Step 2: Configure Apache

In /etc/apache2/sites-enabled (Debian/Ubuntu) or /etc/httpd/conf.d (RedHat/CentOS), create a file named dailymail.conf:

<VirtualHost *:80>
	ServerName dailymail.co.uk
	ServerAlias www.dailymail.co.uk
	DocumentRoot /var/www/html/dailymail
	<Directory /var/www/html/dailymail/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Require all granted
	</Directory>
</VirtualHost>

Step 3: Update /etc/hosts

In the /etc/hosts file, create a new entry. It doesn't matter if there are other 127.0.0.1 lines in the file.

127.0.0.1	www.dailymail.co.uk dailymail.co.uk

Step 4: Reload Apache

There are a few options here, depending on your distribution. At least one of the following will work:

# systemctl reload httpd
# systemctl reload apache2
# service httpd reload
# service apache2 reload

The Apache httpd service is either named httpd or apache2. The command to manage it is likely systemctl reload httpd or service httpd reload, depending on your distribution. If you're using Debian/Ubuntu/etc, replace httpd with apache2 here.

Step 5: Success!

Whenever you click on a Daily Mail link, you will see the replacement page instead:

Daily Fail
How to avoid accidentally clicking Daily Mail articles
Share on Twitter Share on Facebook Share on LinkedIn Share on Identi.ca Share on StumbleUpon