This is a discussion on [How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects within the General Discussion forums, part of the vBSEO SEO Plugin category; Originally Posted by Diver sorry for my dumb question. but i have several urls for my website how do i ...
Domain name forwards to another url is handled through the company you have your domain name(s) registered with. This is done by you.
For example if you use GoDaddy.com you would go into the domain manager, and select the domain you wish to forward. Then simple select forward, add the url you want it to forward to and then choose whether it's a temporary or permanent forward, and then save.
How are they all looking at the same website? Are they parked domains or addon domains?
The Forum Hosting - Forum Hosting from the Forum Experts
In Google Webmaster Tools I have gone to "Site Configuration" > "Settings" and selected the www option under "Preferred domain". Then I get a problem:
"Part of the process of setting a preferred domain is to verify that you own http://example.com/. Please verify http://example.com/"
I have done the www verification by putting the google.html file into my /home/mainwebsite.html/ directory, no problems.
But I have absolutely no idea how to verify my "example.com" address - have googled for about 30 minutes and cannot find any answer - hope you can help.
Last edited by systemsfortraders; 08-16-2009 at 10:05 AM.
Joe didn't say change the Preferred domain in Google webmasters
You just add these lines (in your htaccess file) if you want to use www
And if you want to use non-www you can add these linesCode:RewriteCond %{HTTP_HOST} !^www\.example\.com RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Change example to your site URLCode:RewriteCond %{HTTP_HOST} ^www\.example\.com$ RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
You will notice in the 1st post there are 3 options, .htaccess, Google Webmaster and Lighttpd. It is not clear and I am not clear whether all options should be completed or just one of them.
Being non-technical and not having a clue what Lighttpd is I went for the Google Webmaster option. So, that is the one I am having problems with and the one to which my initial query relates. Hope you can help as it is still a problem and I am concerned unless corrected in Google webmaster tools it will not be right.
NOTE:
I have now made the .htaccess changes. Two questions: 1. Having made these changes do I still need to do the Google Webmaster option ? 2. Should the line of code be:
RewriteRule (.*) http://www.systemsfortraders.com/$1 [R=301,L]
RewriteRule (.*) http://www.systemsfortraders.com/forums/$1 [L,R=301]
And, question 3 - what is lighttpd or should I not ask ?
One last question is this - is there any preference for www. or non-www - e.g. is there any reason to chose one over the other ?
Apologies for all the questions but its an area I am keen to clear up on.
Choose what the version you will use in your site and add the code in your htaccess I change the codes to your site just copy and paste the version code in your htaccess file
if you want to use www
if you want to use non-wwwCode:RewriteCond %{HTTP_HOST} !^www\.systemsfortraders\.com RewriteRule (.*) http://www.systemsfortraders.com/$1 [R=301,L]
After add the code in htaccess you will not need to change your preferred domainCode:RewriteCond %{HTTP_HOST} ^www\.systemsfortraders\.com$ RewriteRule ^(.*)$ http://systemsfortraders.com/$1 [L,R=301]
Check Out Wiki : lighttpd - Wikipedia, the free encyclopedia
Thanks,
From your response I think that the following is true, appreciate if you can confirm:
1. I use the rewrite code "RewriteRule (.*) http://www.systemsfortraders.com/$1 [R=301,L]", the first bit of code I mentioned in my original message?
2. After making this change in .htaccess I do not need to make any changes to Google Webmaster tools or to lighttpd ?
3. You did not answer my question "is there any preference for www. or non-www - e.g. is there any reason to chose one over the other ?"
Thanks again for the quick responses.
Add this code in your htaccess and you are done
2. YesCode:RewriteCond %{HTTP_HOST} !^www\.systemsfortraders\.com RewriteRule (.*) http://www.systemsfortraders.com/$1 [R=301,L]
3. That's as you like if you want to use www or not there are doing the same thing
Thanks, again.
Hi,
I used this code but there is a issue. I have a subdomain so when i put the code, if i want to enter the subdomain, there is a problem.
How can i use this code only for my main site ?
For instance:
www.mysite.com
subdomain.mysite.com
I only want to apply this code for my main site. if the url is subdomain.mysite.com the code musn't do something.
Thanks
Thanks i used to use this code. But when i put it into the ftp, subdomain url is changing to http://www.domain.com/subdomain_name
I want to make it: subdomain_name.domain.com
If you are using a subdomain, you need to use different code in the subdomain folder. The root url (www.domain.com) should use the above code.
and in the subdomain folder, use this in your htaccess:
RewriteCond %{HTTP_HOST} !^subdomain\.domain\.com
RewriteRule (.*) http://subdomain.domain.com/$1 [L,R=301]
Brian Cummiskey / Crawlability Inc.
vBSEO 3.6.0 GOLD Released!
Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!