Protecting staging sites with Basic Authentication

This approach was primarily devised for use with WP Engine staging sites, but will work in any situation where you have no access to Apache’s config and need to use a single .htaccess file for multiple domains (e.g. a multisite setup). We’ve recently had a couple of projects hosted on WPEngine where we need to …

Setting HTTP Basic Authentication based on the host name

For many of our projects, the .htaccess file is under version control… but at the same time, I need to put HTTP Basic Authentiation on just the staging site. Unfortunately the host weren’t able to do this for me, but with a little .htaccess trickery I was able to detect the staging site URL and …

WordPress and basic authentication, problems with WP Cron and file uploads

I have a Google ego search on my name, so I can keep track of what the Internets is saying about me behind my back. The other day the ego search summary email arrived and included was one of my development sites. Which was annoying because I don’t want people browsing around my development, it …

Problems with .htaccess and AFP over Netatalk

After yesterdays triumph of establishing contact with my virtual server over AFP, using Netatalk, I was perplexed today to find that my .htaccess files weren’t having any effect. Listing the files on the shared volume on my Mac seemed to show that they were there: ~$ ls -Al /Volumes/Home Directory/www/sites/jackspeak/site/ total 736 -rwxr-xr-x 1 simon …

Simple Apache redirects

If you look around the web, you’ll see endless tutorials on how to configure Apache to do redirects using mod_rewrite. Undoubtedly mod_rewrite is a powerful way to control access and redirects on your Apache server, and it is enabled on many web hosts, but before you dive into the complexity and regular expressions of mod_rewrite, …