The Web Developer's Blog has been discontinued. I am now maintaining a new blog that is related to my company, Blue Piccadilly. The most popular articles from this blog (by monthly page views) have already been republished on the new blog, and indeed those original pages on this blog are being redirected to their new location. I'll probably keep these pages up here for a while. At least until the domain expires.

Server stuff

Dec11

Use Mod Rewrite to redirect visitors requesting a specific host to a new host

11-Dec-2008
Filed under: Server stuff

To redirect visitors requesting a specific host name to a whole new host name, use the following snippet in your .htaccess file:

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_HOST} ^(www\.)?oldhost\.com$
  RewriteRule ^(.*)$ http://www.newhost.com/$1 [R,L]
</IfModule>

This will check for visitors requesting either oldhost.com or www.oldhost.com and redirect them to www.newhost.com.

Oct04

Set up SSH keys to automate server logins

04-Oct-2007
Filed under: Server stuff

Tired of typing your passwords all the time?

Check out this excellent guide on how to set up SSH keys on your web server to automate logins from your SSH client.