Articles by Perishable Press

  • Blackhole for Bad Bots – PHP Version

    This post summarizes Blackhole for Bad Bots version 4.0+. For older versions, check out the original tutorial. Please read the original tutorial for download, demo, and important information about the standalone PHP version of Blackhole for Bad Bots. The following guide is meant to simplify things for users of Blackhole version 4.0 and better. Trap […]

    READ MORE
  • Trying Different Email Clients for Mac

    As a professional web developer slash book author, I spend a LOT of time with email. Recently, I discovered that my email client does not provide some of the functionality that I require. So I set out on a mission to find something that works. Something better. This article aims to add to the rather […]

    READ MORE
  • Tips for Atom Code Editor

    For some of my tutorials, I use the Atom Code Editor. It’s not as easy as Coda, but it does provide a LOT more flexibility in terms of configuration and customization. Over the last couple of years, I’ve collected a handful of useful tips and tricks for dialing in the perfect Atom environment. Well, perfect […]

    READ MORE
  • Redirect Query String via .htaccess

    In general, redirecting URLs is a piece of cake with Apache’s .htaccess. The only trick is redirecting based on the URL’s query-string value. Doing so requires slightly different directives that many people are not aware of, so it’s common to see a questions like, “why isn’t my redirect working for query strings?” This quick tutorial […]

    READ MORE
  • How to use the HTML <base> tag

    When every byte counts, you can use the HTML base tag to specify a default href and target attribute for all relative URLs on the page. For smaller sites with a flat directory structure, this isn’t going to help much; but for sites with deeply nested directories, the base tag can potentially shave a lot […]

    READ MORE
  • How to Redirect URLs

    Want to redirect a URL from one location to another? This simple guide shows you how to do it with Apache/.htaccess, PHP, JavaScript, HTML, and more. Each redirect technique is briefly explained and includes ready-to-go, copy–paste examples. Just grab the code you need and use it in good health. May the redirects be with you! […]

    READ MORE
  • Detect Attacks with PHP and .htaccess

    This tutorial explains how to detect and block security threats via .htaccess, and then pass that information to a PHP script for further processing. This is a powerful technique that combines the power of Apache with the flexibility of PHP. Enabling you to do things like log all unwanted traffic, send email reports for blocked […]

    READ MORE
  • Email Troubleshooting Guide

    I often say that email is the “glue” that holds the Internet together. But it’s like the worst possible glue ever. It’s underlying technology is convoluted, complicated, insecure, tedious, sloppy, and archaic. In a nutshell: email sucks but it’s pretty much essential for working online. So what do you do if email is not working, […]

    READ MORE
  • Examples of Nested Encoding

    Typically malicious scans use some sort of encoding to obscure their payloads. For example, instead of injecting a literal script, the attacker will run it through a PHP encoding function such as base64_encode(), utf8_encode(), or urlencode(). So if and when you need to decode some discovered payload, you can use whichever decoding function will do […]

    READ MORE
  • Customer Anti-Support

    Email support can be great or it can suck horribly. It’s a spectrum. For my own products and services, my average email response time is around 1 hour in general, and 5 minutes if I am online. Seriously, I am right there ready to help anyone who needs it. Contrast that strategy to what seems […]

    READ MORE
  • Watch Cyber Attacks Online

    Taking a quick break to watch cyber attacks happening in real time. Lots of cool “threat maps” to check out: Cyberthreat Real-Time Map (kaspersky.com) Global Internet Attacks Map (atomicrbl.com) Threat Map (fortiguard.com) Digital Attack Map (digitalattackmap.com) Threat Map (fireeye.com) Live Attack Map (norsecorp.com) You can find more of these nifty tools via search engine. Good […]

    READ MORE
  • Disable WordPress Responsive Images

    WordPress responsive images are awesome. But some people want to use their own methods to implement. This post explains how to disable WordPress responsive image functionality so that you can use your own methods. It makes things easier when you don’t have to wrestle with what WordPress is doing. tl;dr Grab the plugin. WordPress responsive […]

    READ MORE
  • Display bbPress Posts without a Plugin

    I recently redesigned my .htaccess site, htaccessbook.com. Before the redesign, I was using bbPress for the forum functionality. It worked okay for a few years, but along the way there were all sorts of really nasty bugs and important things breaking. It seemed like, no matter what, each updated version of the bbPress plugin caused […]

    READ MORE
  • Redirecting URLs that Include Numbers

    Redirecting stuff with .htaccess generally is pretty straightforward, but there can be a lot of confusion when it comes to targeting patterns that include numbers. I think this largely is due to the syntax used for matching numbers in regular expressions. It’s sort of unintuitive until you get the hang of it. So to help […]

    READ MORE
  • How to Block Bad Bots

    Suffering from spammers, content scrapers, bandwidth leeches, and other bad bots? Got some loser stalking your chat forum? Site getting scanned by endless malicious requests? In this tutorial, you’ll learn how to block bad bots and users with minimal effort. Keeping the trash away from your site is gonna free up valuable server resources, conserve […]

    READ MORE
  • Bulletproof Sitemap Redirects via .htaccess

    Sitemaps have been shown to help search engines and other visitors understand and navigate your website. This tutorial gives you a simple yet powerful .htaccess technique for ensuring that search engines and other visitors can easily find your sitemap files. So even if they are looking for your sitemap in the wrong location, they’ll always […]

    READ MORE
  • WordPress .htaccess file

    The WordPress core uses .htaccess for two things: Permalinks and Multisite. This means that .htaccess is only required if you have enabled either of these features. Otherwise, .htaccess is entirely optional for default WordPress installations. Beyond the WP core, many plugins also use the .htaccess file for custom directives involving rewrites, redirects, custom headers, file […]

    READ MORE
  • Block Proxy Visits with PHP

    I wrote recently about how to block proxy visits with WordPress. That article provides a simple, plug–play script that you can drop into WordPress-powered site. This article goes further with two effective techniques for blocking proxy visits to your site using only PHP. These techniques work for any PHP-enabled site, including WordPress, Drupal, Joomla, and […]

    READ MORE
  • Worst IPs: 2016 Edition

    A little late this year, but following tradition here is my list of the absolute worst IP addresses from 2016. All in nice numerical order for easy crunching. These IPs are associated with all sorts of malicious activity, including exploit scanning, email harvesting, brute-force login attacks, referrer spam, and everything in between. Really obnoxious stuff […]

    READ MORE
  • Get Random with PHP

    This tutorial explains numerous ways to get random items via PHP: numbers, strings, passwords, nonces, images, and more. I use these techniques in various projects, and want to round them all up in one place for easy reference. I’ll be updating this post with additional techniques as I get them. Get a random number This […]

    READ MORE