Redirection with a wildcard

In your wp-config.php Just put this rule in there:

define('WP_HOME','http://www.yourdomain.com');
define('WP_SITEURL','http://www.yourdomain.com');

Put it right above:

/* That's all, stop editing! Happy blogging. */