Forum Moderators: phranque
I'm using the following code extracted from one of one of jdMorgan's post to redirect blog.mydomain.com to www.domain-blog.com:
RewriteEngine On
RewriteCond %{HTTP_HOST} blog\.mydomain\.com
RewriteRule (.*) http://www.domain-blog.com/$1 [R=301,L]
It's seems to work fine except for one small thing. The following redirectios happens:
I'm placing the .htaccess at www.mydomain.com and I kept the following lines at the DNS zone of mydomain.com:
Can anyone give me a hand of this please? Can't seem to do the right thing.
[edited by: JMZolezzi at 11:59 pm (utc) on May 20, 2008]
It's very likely that this code is present. The trick is to get your new redirect code to execute first.
If that's not possible, then the work-around is to put "^blog/" at the start of your RewriteRule pattern, outside of the parenthesized ".*" expression.
Jim