Redirecting a sub domain with htaccess
I have not needed to redirect sub domains before but after installing wordpress 3 for a client (and activating the multiple blogs option) the client wanted one of their sub domains to always point to their home page instead of the standard Registration has been disabled text.
To do this all you need to do it edit the .htaccess file on the server (if your running apache) with the following code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain.yourdomain.co.uk$ [NC]
RewriteRule (.*) http://www.yourdomain.co.uk/$1 [R=301,L]
Of course replace subdomain.yourdomain.co.uk with your own subdomain and main domain name.
If anyone has used any wordpress plugins to achieve this then please drop us a comment if they have worked well as its not always possible of course for people to edit their .htaccess file.






Latest from Twitter
This is great if your using a multi site version of WordPress and you want to redirect a certian sub domain to another part of the site you would otherwise get a blog not found error
I am stuck with my web site to do a 301 redirect. I tried with the rule you specified in post. pls help with a good solution
a 301 redirect is different to redirect all traffic to another site using .htaccess you would use the following:
This redirects your entire website to another domain
Redirect 301 / http://www.your-site.com/
This redirects index.html to a specific subfolder
Redirect /index.html http://www.your-site.com//newdirectory/