Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two domains hosting in two different servers: &

I would like to forward "" to "" which is a Wordpress blog using CNAME redirect.

Before I installed Wordpress. (=redirect=>)
(working fine)

The browser will keep the URL ( even the index.htm is on server.

However, after I installed Wordpress, the browser will change the URL to (

This is my current setup:

On DNS: CNAME redirect to

on .htaccess:

Options +FollowSymLinks 
RewriteEngine On 
RewriteCond  %{HTTP_HOST} ^blog\.domain1\.com 
RewriteRule ^(.*)$$1 [R=301,L]

on .htaccess:

DirectoryIndex index.php
<IfModule mod_rewrite.c> 
Options +FollowSymLinks
RewriteEngine On 
RewriteBase /blog2/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /blog2/index.php [L]
</IfModule> is installed under

All I want to do is keeping the URL ( unchanged for the whole Wordpress redirect.

share|improve this question
CNAME is an alias of a domain, not redirection. – YOU Jun 4 '10 at 4:38

I don't think the .htaccess in will work. In your configuration, it will not never be hit. The easiest way is just remove your cname setting and keep your .htaccess in You probably need to learn more on how DNS and Apache works.

share|improve this answer
Sorry, I mean you can put RewriteEngine On RewriteCond %{HTTP_HOST} ^blog\.domain1\.com RewriteRule ^(.*)$$1 [R=301,L] in's .htaccess – blackswan Jul 9 '10 at 6:47

In your domain2 .htaccess file replace R=301 with R=302

That tells its a temporary redirection which will keep the url address. But keep in mind, the url address will always be [even if you are reading a permalink post within domain2]

share|improve this answer
Thanks so much for your response. However, after I change it to R=302. The URL is always (I want to keep it as even the post is hosted under domain2) Thanks! – Vincent Chan Jun 9 '10 at 11:43

Until you can fix rewrite rules you can use Redirection Wordpress plugin:
"Manage all your 301 redirects and monitor 404 errors"

Easy to use.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.