Comments on: Redirect Visitors From Non-WWW To WWW Version Of Your Website With .htaccess And mod_rewrite http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/ Thu, 11 Mar 2010 21:44:16 +0000 http://wordpress.org/?v=2.2.1 By: SEO Basic Guide and Techniques http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-27510 SEO Basic Guide and Techniques Sun, 24 May 2009 17:39:34 +0000 http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-27510 That’s a great idea I’ll try it as well Thanks for the post That’s a great idea I’ll try it as well

Thanks for the post

]]>
By: John http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-21478 John Wed, 17 Dec 2008 22:44:19 +0000 http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-21478 Well written and much appreciated. I'm finally getting around to this on a site that I purchased almost two years ago. You say that <em>"Changing this after you’ve already been indexed can have some unwanted efffects, like loss of PageRank or a complete removal and then reindex of your website by the search engine bots."</em>Is that still the case, and if so, what do you recommend? This site has been online since 1997! Thanks again. -jp Well written and much appreciated. I’m finally getting around to this on a site that I purchased almost two years ago. You say that “Changing this after you’ve already been indexed can have some unwanted efffects, like loss of PageRank or a complete removal and then reindex of your website by the search engine bots.”Is that still the case, and if so, what do you recommend? This site has been online since 1997! Thanks again. -jp

]]>
By: robin http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-19925 robin Thu, 06 Nov 2008 15:07:49 +0000 http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-19925 Hi, can someone please help me? I've been trying to redirect beka.co.uk to a www.beka.co.uk for a while now and am having no luck. The following is the first three lines or my .htaccess file... RewriteEngine On RewriteCond %{HTTP_HOST} ^beka\.co.uk$ [NC] RewriteRule ^(.*)$ http://www.beka.co.uk/$1 [R=301,L] The site is running on an apache server, but i don't have access to http.conf file, is this where my problem lays? Any advice would be greatly received as this is starting to bug me Cheers Hi, can someone please help me?

I’ve been trying to redirect beka.co.uk to a www.beka.co.uk for a while now and am having no luck.

The following is the first three lines or my .htaccess file…

RewriteEngine On

RewriteCond %{HTTP_HOST} ^beka\.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.beka.co.uk/$1 [R=301,L]

The site is running on an apache server, but i don’t have access to http.conf file, is this where my problem lays?

Any advice would be greatly received as this is starting to bug me

Cheers

]]>
By: Guido Bouman http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-17145 Guido Bouman Sun, 14 Sep 2008 11:53:05 +0000 http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-17145 This can be made even better. I was developping a CMS that has to run on multipile domains, so to make it work I hade to mak my .htaccess work with every domain. For forcing www.: [code]RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www\.%{HTTP_HOST}/$1 [R=301,NC,L][/code] And for stripping it: [code]RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,NC,L][/code] This can be made even better. I was developping a CMS that has to run on multipile domains, so to make it work I hade to mak my .htaccess work with every domain.

For forcing www.:
[code]RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www\.%{HTTP_HOST}/$1 [R=301,NC,L][/code]

And for stripping it:
[code]RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,NC,L][/code]

]]>
By: Marco http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-13601 Marco Mon, 16 Jun 2008 18:33:06 +0000 http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-13601 Great tip. Works perfectly for what I needed. Everyone should think about doing this because it's better for seo to use one domain or the other. Not both. Otherwise, you can get treated as 2 different sites. Google does a pretty good job of knowing, but the lesser known sites won't give you as much credit for backlinks if your links are spread across different domains, e.g.: domain.com vs. www.domain.com Great tip. Works perfectly for what I needed. Everyone should think about doing this because it’s better for seo to use one domain or the other. Not both. Otherwise, you can get treated as 2 different sites. Google does a pretty good job of knowing, but the lesser known sites won’t give you as much credit for backlinks if your links are spread across different domains, e.g.: domain.com vs. www.domain.com

]]>
By: George http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-4382 George Mon, 31 Mar 2008 17:45:40 +0000 http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-4382 Great tip. Apache rewrites are great, but sometimes a royal pain. Great tip. Apache rewrites are great, but sometimes a royal pain.

]]>
By: gakyi http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-1489 gakyi Wed, 03 Oct 2007 04:01:54 +0000 http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-1489 thank you for this www tip. thank you for this www tip.

]]>
By: huckle http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-1473 huckle Sun, 22 Jul 2007 19:32:23 +0000 http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-1473 Sorry to post twice, I said tdl not tld in my previous post. Apologies. Sorry to post twice, I said tdl not tld in my previous post. Apologies.

]]>
By: huckle http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-1472 huckle Sun, 22 Jul 2007 19:30:54 +0000 http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-1472 Nicely explained. Too often are the mysteries of mod_rewrite overcomplicated by poor authorship. As for non-www or www, you contradict yourself by saying you prefer to use non-www in the article body yet in th title you say "From Non-WWW To WWW Version". My own opinion is that the uninitiated and less geeky audience use www, but in time people work out they can be lazy. I use firefox, so don't even bother with the tdl if I can get away with it; most often google redirects you straight to the site you want anyway. If there isn't one that matches you can just click it from the results page. Also helps with spelling mistakes as google is great at suggesting alternatives... Nicely explained. Too often are the mysteries of mod_rewrite overcomplicated by poor authorship. As for non-www or www, you contradict yourself by saying you prefer to use non-www in the article body yet in th title you say “From Non-WWW To WWW Version”. My own opinion is that the uninitiated and less geeky audience use www, but in time people work out they can be lazy.

I use firefox, so don’t even bother with the tdl if I can get away with it; most often google redirects you straight to the site you want anyway. If there isn’t one that matches you can just click it from the results page. Also helps with spelling mistakes as google is great at suggesting alternatives…

]]>
By: Kevinpan http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-1348 Kevinpan Thu, 07 Jun 2007 04:55:24 +0000 http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/#comment-1348 It seams good idea. I'll try it on my site. thank you writer. It seams good idea.
I’ll try it on my site.
thank you writer.

]]>