Server setup and configuration

Dec11

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

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

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.