Forum Moderators: phranque
Sorry about bad english, i'm brazilian..sorry...
[edited by: jdMorgan at 4:02 am (utc) on Mar. 15, 2004]
[edit reason] Examplified URL, de-linked [/edit]
If REQUEST_URI contains
/blog/ and HTTP_HOST is www.example.com.br, redirect (301 or 302) to http://blog.example.com.br/. If HTTP_HOST is
blog.example.com.com.br, do a silent redirect to the page for www.example.com.br/blog/. [edited by: jdMorgan at 4:03 am (utc) on Mar. 15, 2004]
[edit reason] Examplified URL [/edit]
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteCond %{REQUEST_URL} ^/blog/
RewriteRule ^(.*) [blog.example.com$1...] [R=301,L]
RewriteCond %{HTTP_HOST} ^(blog)\.example\.com [NC]
RewriteRule ^(.*) [example.com...] [L]