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 …

WP Super Cache and WP Touch (Pro)

On one client’s site we’re using WP Super Cache and WP Touch Pro, and it bothered me that while WP Touch Pro ensures that mobile users get a lovely optimised theme, it wasn’t serving cached pages for those queries. Until recently we were hacking both WP Super Cache and WP Touch (pre-Pro) to achieve this, …

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, …