zenite
Feb 16th 2008, 9:06 pm
I been searching around but cant find a solution to this, so pls help.
I have a subdomain that I want to redirect using .htaccess.
from
www.domain.com/subdomain
to
www.subdomain.domain.com
and also to remove the www
from
www.subdomain.domain.com
to
http://subdomain.domain.com
I tried the following but it didn't work.
#remove www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.subdomain.domain.com [NC]
RewriteRule ^(.*)$ http://subdomain.domain.com/$1 [L,R=301]
#redirect directory to subdomain
RewriteCond %{HTTP_HOST} !^subdomain\.domain\.com
RewriteRule (.*) http://subdomain.domain.com/$1 [L,R=301]
what it does is redirect www.subdomain.domain.com to www.domain.com/subdomain/ and does nothing to the www.
pls specify if the .htaccess should be uploaded to the public_html folder or public_html/subdomain folder
I have a subdomain that I want to redirect using .htaccess.
from
www.domain.com/subdomain
to
www.subdomain.domain.com
and also to remove the www
from
www.subdomain.domain.com
to
http://subdomain.domain.com
I tried the following but it didn't work.
#remove www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.subdomain.domain.com [NC]
RewriteRule ^(.*)$ http://subdomain.domain.com/$1 [L,R=301]
#redirect directory to subdomain
RewriteCond %{HTTP_HOST} !^subdomain\.domain\.com
RewriteRule (.*) http://subdomain.domain.com/$1 [L,R=301]
what it does is redirect www.subdomain.domain.com to www.domain.com/subdomain/ and does nothing to the www.
pls specify if the .htaccess should be uploaded to the public_html folder or public_html/subdomain folder