vBulletin Search Engine Optimization
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; Most websites are setup to allow access via either www or non-www. Example: Code: vbseo .com or Code: www. vbseo ...
| |||||||
Enhancing 80 million pages. | Register | FAQ | Members List | Social Groups | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| ||||
| ||||
|
Most websites are setup to allow access via either www or non-www. Example: Code: vbseo.com Code: www.vbseo.com For best SEO, you need to choose one version or the other, to ensure full link consistency and consensus, and to maximum crawling efficiency. There are 2 methods of specify which version to use. One is by using your .htaccess file. The second way is to select your preferred format within Google Webmaster Tools. Choosing to Use the WWW version of your domain ONLY Edit your .htaccess file. At the top, add the following new lines: Code: RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Once your new .htaccess file is uploaded to the server, your site will ONLY be accessible via the WWW version of your domain. Anytime a user or search engine tries to access the non-WWW version of your site, they will be automatically forwarded to the WWW version. Choosing to Use the NON-WWW version of your domain ONLY
Code: RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
Once your new .htaccess file is uploaded to the server, your site will ONLY be accessible via the NON-WWW version of your domain. Any time a user or search engine tries to access the WWW version of your site, they will be automatically forwarded to the NON-WWW version. Choosing WWW or NON-WWW version of your domain in Google Webmaster Tools If you are not yet using Google Webmaster Tools, you should be. It provides a wealth of info on how to improve your site for SEO purposes. Here is a primer on some of the key aspects you should be evaluating with your account: Google Webmaster Tools - Recommended for All vBSEO Customers To specify which version of your domain to use, login to your account and go to the following section: Go to Dashboard > Tools > Set preferred domain Quote:
Google will then ONLY list the WWW or NON-WWW version of your URLs in the index, whichever you select. Lighttpd Webserver Choosing to Use the WWW version of your domain ONLY Please add the following rule to your lighttpd.conf file. In order to edit lighttpd.conf you can use the following command. Code: # vi /etc/lighttpd/lighttpd.conf Code: $HTTP["host"] =~ "^domain\.com$" { url.redirect = ( "^/(.*)" => "http://www.domain.com/$1" ) }
Code: # service lighttpd restart # /etc/init.d/lighttpd restart Choosing to Use the NON-WWW version of your domain ONLY Please add the following rule to your lighttpd.conf file. In order to edit lighttpd.conf you can use the following command. Code: # vi /etc/lighttpd/lighttpd.conf Code: $HTTP["host"] =~ "^www\.(.*)" { url.redirect = ( "^/(.*)" => "http://%1/$1" ) }
Code: # service lighttpd restart # /etc/init.d/lighttpd restart
__________________ Joe Ward / Crawlability Inc. vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD 6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You. Last edited by Joe Ward; 03-22-2008 at 06:24 PM. |
|
#2
| |||
| |||
|
Thanks, I could have used this about a year ago when I first set this up on my sites lol. I'm sure this will be helpful for many users though! |
|
#3
| ||||
| ||||
|
Good point Justin. We'll try to do a better job of getting common questions clearly documented on the site.
__________________ Joe Ward / Crawlability Inc. vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD 6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You. |
|
#4
| ||||
| ||||
|
#5
| ||||
| ||||
|
__________________ Joe Ward / Crawlability Inc. vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD 6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You. |
|
#6
| |||
| |||
|
I guess it is not a good idea for active forums, because all of my pages indexed with www. so if i drop www. it means my index will be decrease than google have to reindex new pages without www
|
|
#7
| ||||
| ||||
|
the htaccess rule 301's it. you shouldn't lose any ranking. Plus, in the google webmasters portal, you can set www vs non-www right there. so even if all your links are www in there, you can have them send to non-www. |
|
#8
| ||||
| ||||
|
If you already have www indexed, and you are ok with that, I think you are very safe to stick with it. We use www here and we won't be changing, even though a few of my own private sites are setup without it. One thing we have to consider is "user behavior". It's quite common when someone types in a domain (from memory) that they may include the www part since it's been used so prominently from the early beginnings of the Web.
__________________ Joe Ward / Crawlability Inc. vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD 6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You. |
|
#9
| ||||
| ||||
|
or, they type 'site' and hit ctrl + enter, which auto adds http and www and .com to it
|
|
#10
| ||||
| ||||
|
Interesting. Good point. One thing that has always bothered me is sites that allow one or the other, but do NOT redirect the non-preferred version. I have seen major websites (even recently) that give a 404 error if you enter the domain without the www. part.
__________________ Joe Ward / Crawlability Inc. vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD 6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You. |
|
#11
| ||||
| ||||
|
that's because IIS sucks oh, wait... i didn't mean to say thaty out loud |
|
#12
| |||
| |||
| Sorry, didn't mean for it to sound like I was complaining :P You guys do a great job with presenting useful information here.
|
|
#13
| ||||
| ||||
| Quote:
__________________ Joe Ward / Crawlability Inc. vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD 6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You. |
|
#14
| |||
| |||
|
Thanks, I did it on all my sites.. I had set the Google preferred domain, but did not have the code in .htaccess
|
|
#15
| |||
| |||
|
Just posting to make that annoying message go away at the top of the page.
|
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Urgent help with htaccess and 301 redirects | markbolyard | URL Rewrite Settings | 4 | 12-02-2007 05:24 PM |
| htaccess redirects when moving folder | I, Brian | Troubleshooting | 3 | 10-05-2007 02:47 PM |
| Help with initial htaccess setup | mhc1576 | URL Rewrite Settings | 1 | 12-28-2006 07:44 AM |
| 301 redirects disabled, vBSEO still redirects to new archive | PageUp | Troubleshooting | 6 | 10-23-2005 01:32 PM |