Colin Gallagher

I like to make things and write about stuff.


Back to Home


Rickrolling with Redirects

17 May 2020

I was inspired by this tweet πŸ‘‡ from Liam Hammett to write a brief post on rickrolling people who try to break into your site using common URLs.

πŸ™ƒ Make sure to rickroll people trying to break into your site pic.twitter.com/4cd80Pr9p9

— Liam Hammett (@LiamHammett) May 14, 2020

A lot of websites use the same tech (Wordpress), and thus some of the same URLs are used for logins and admin pages. Which makes them easy targets for jerks.

With Wordpress those paths are most commonly:

Luckily if your site is a static site, you don’t have to worry about those particular login URLs doing anything.

When I saw the above tweet from Liam, I thought it would be fun to put together my own version of the script for my site. I don’t currently use a CMS on my live site so I’m including both the /admin and /login urls. If you have a live CMS you could exclude those.

My _redirects Script

This script uses Netlify redirects in order to send people who visit these urls to the award winning 1987 debut single from Rick Astley. If you host your site with Netlify you can add this script to the root of your site and do the same.

You can see this in action by trying to go to https://colingallagher.me/wp-admin

Rick Astley Dancing

Tags