Hi all, I've just created a site and had been marketing it as example.com (i.e. without the "www"). I just noticed that some directories require the link that I submit to be with "www". So I change all my links now to be with "www"? Are there other reasons I should use "www"? Thanks!
Mostly it's a personal preference, but regardless of whether you choose to use or not use www. in your URLs, you should pick one, be consistent, and redirect the other one to the version you chose.
Hi Dan, Thank you for your reply. I actually decided on "no www". And I had been consistent with my links, both external and internal. And my site is set-up to re-direct to the "no www" if visitors entered via the "www". So everything was fine till I tried to get a listing in a directory, that require the link to be with "www". So my worry is that I would end up splitting my backlinks between the 2 urls, and effectively halving the positive effects. Is my worry unfounded?
This is why you 301 redirect one to the other; this properly transfers over the link\Pagerank value. This way even if you use the non-www version you can still submit your site to directories with the www in the URL syntax. Use the below code in your .htaccess to properly forward the domain URL. Make sure to change your domain to yours, leave all variables intact. RewriteEngine on RewriteCond %{HTTP_HOST} ^www.yourdomain\.com$ [NC] RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,L] Code (markup):
hmm, never thought about this. thanks for the post! do search engines actually look at www and non-www as different domains... ?
Yes, they consider them different "web pages". You also want to redirect your index file to your domain name as well, see below... These are all considered seperate webpages... domain.com www.domain.com domain.com/index.html www.domain.com/index.html RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://mywartremover.com/ [R=301,L] Code (markup): I assumed thats the domain your taking about.. visit the URL with index.php and without before adding the code, it will load the same web page
its up to you, but whatever you choose you should be consistent. as long as you 301 redirect one to the other, you should be fine, even if the directory require www.
Thanks ssandecki! About the htaccess file, as my site was built using Wordpress, my current file looks like this: Can I still add the lines you mentioned, or do I need something else?