How to redirect to subdomain

solvberg's Avatar, Join Date: Dec 2009
Newbie Member
Hello there!

I do have a domain, where the main domain is now empty,

I do have a sub domain, where I do have my blog.

I would like to redirect people who land on my main domain to the subdomain. The people who are redirected do not need to know they are redirected, so the url could still show the main domain. And also, is possible to make such redirection SEO friendly?

I understand this can be done with a .htaccess file, but I need help to make that file.

Later I may be make a bigger web site at the main domain, and the blog will continue, but then as a part of the bigger site, but that is later.

Is there anyone who can help me make a .htaccess file?

Best regards, Jan
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
No Such a redirect would not be SEO friendly because you will have 2 urls for same content but instead of redirect without having url not change try redirect with URL change as that will be SEO friendly
0
solvberg's Avatar, Join Date: Dec 2009
Newbie Member
Thank you for quick response Shabbir.

The problem as a novice I need help for what to put into that .htaccess file. What commands and so on.

I hope you can help me with this.

Best regards, Jan
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
First do you want to redirect to you want to show on both the domains.

Let me know and I will share what you should put in .htaccess
0
solvberg's Avatar, Join Date: Dec 2009
Newbie Member
Thank you Shabbir for quick response again.

I would like to redirect people automatic to the blog domain. If they can see that they are redirected or not, is not important. Just to move them to the subdomain and open the wordpress blog I have there. But also to keep it SEO friendly.

The thought is to keep the main domain empty at the moment, to be able to use it in the future.

If there is no simple way to do this I will rather move my blog to the main domain.

I hope you can help me and that you now have enough information about it.

Best regards, Jan
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Use the following

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} old\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://new.domain.com/$1 [R=301,L]
venami like this