Goodbye dot com hello dot uk!

Dot com. Remember those grey old days when to be on the internet you had to be a dot com. It was easy to remember. dot co dot uk - what a mouthful, and anyway, I'm not (yet) a company. So I've moved to a .uk domain. It was surprisingly painfree!

Change domains without losing emails - thanks exim4

So all my clients have my old dot com email address. I will tell them about my move to dot uk, but the old address is going to be used for a while yet, I suspect. There's important services with my old address(es) and all the forums I've signed up to etc.

I didn't want to lose any of these by switching to dot uk.

I use exim4 as my mailserver (MTA). I really like the way the config is broken down into manageable bits, although the syntax is a bit out there and the docs are a bit accademic.

I added an exim router to redirect all mail from one domain to another, keeping the local part the same. So foo@old.com → foo@new.com.

Here's how that looks:

### 920_exim4-config_domain_change
#################################
domain_change:
  debug_print = "R: domain_change for $local_part@$domain"
  driver = redirect
  domains = lsearch;/etc/exim4/redirect_domains
  data = ${local_part}@${lookup {${domain}} lsearch {/etc/exim4/redirect_domains}}
  no_more
#####################################################

And it just needs a simple text file at /etc/exim4/redirect_domains:

artfulrobot.com:artfulrobot.uk

It seems to work really well. I can receive mail to any old address and it comes to the new.

Websites

This site used to be artfulrobot.com. This was achieved through some simple RewriteRules. In the Apache default vhost I now have:

RewriteEngine On
RewriteCond %{HTTP_HOST} 	^www\.artfulrobot.(uk|com)$	[NC,OR]
RewriteCond %{HTTP_HOST} 	^artfulrobot.com$	[NC]
RewriteRule ^(.*)$	http://artfulrobot.uk$1	[L,R=301]

 

 

Add new comment