I've seen mention several times about PR being different for domain.com and www.domain.com Several commentators mentioned that this is because the search engines consider them each as different URLs. Before I came on this forum, I didn't even know you could have a domain without the WWW. How are such domains created? With all my domains, I have just created the account using WHM (Web Host Manager) and normally just put in domain.com in the domain box. Does this mean that all my domains should really be referenced as domain.com rather than www.domain.com? OR, have I got the worng end of the stick completely, and, as long as I consistently use www.domain.com in any backlinks, it isn't going to be relevant?
In Apache, you would simply configure it as a different site. And you would of course need a DNS entry for it as well.
basically www.domain.com and domain.com are the same thing (if you dont have them seperated.) if you have all of your links going to one or the other. Question for Shawn- How can you redirect a domain.com to www.domain.com so the PR from sites linking to that transfers over?
The WHM server usually configures Apache so that your domain will work with and without the www. For best PR, you should pick one and always use the same form for all links and backlinks.
schlottke, let me take that down from shawns back you can use apaches mod_rewrite and setup 301 redirection rule. for instance, something like: RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteCond %{HTTP_HOST} ^digitalpoint\.com RewriteRule ^(.*)$ http://www.digitalpoint.com/$1 [R=permanent] in .htaccess should do the job.
Such a redirect, from the "deprecated" form to the "preferred" form (and which is which does not matter, just pick one) is something that every single website absolutely, positively should have in place. This is the third time just today that I have had occasion to post that, across two forums, so I guess it's not as nearly universal knowledge as it should be.
Try this: RewriteEngine On RewriteCond %{HTTP_HOST} ^resalebroker.com RewriteRule (.*) http://www.resalebroker.com/$1 [R=301,L] Works for me..
The way we do it on our FreeBSD/Apache server is to simply set up a symbolic link at the O/S level so that if anyone tries to enter domain.com they are taken to the content of www.domain.com. But we are very careful to have all links internal and external point only to the "www" version.
Yep - consistency with linking will take care of it. But it pays to cover the bases just the same.. Actually, if you take a look at your cpanel acct (as created under WHM) and open the file manager, you'll find that www is treated as a subdomain. It lives in acct root as a sym link (represented as a folder (www) in the file manager). So, you can reference your domains either as wxyz.com or www.xyz.com. The trick is to ensure that all links to your domain are either one OR the other. I'd be inclined to use mod_rewrite to redirect from wxyz.com to www.wxyz.com - there's plenty of info around on how to script mod_rewrite.
The crucial thing, I reckon, is that a 301 Redirect be issued by any call to the "wrong" URL form. The point is not to make sure that the visitor (or searchbot) finds your site--it would be rare for a call to one form not to "reach" the other--but that the searchbots see a 301 for the deprecated form, so that links from others (whose exact form we can never fully control) are all "counted" against the preferred URL form.
there is a simple PHP fix to the duplicated www. domain.com -> domain.com content problem on php9.com
I think it's been the default behavior for many years at almost all web hosts to make domains accessible with or without the www. What surprises me in reading this thread is that the posted redirect rules reroute TO the www version rather than the other way around. www should be preserved for the few people out there who still habitually type www in front of everything, but I'd think the version without www would by far be the preferred form for its elegance and simplicity.
Just thought I'd mention this as I had a hard time finding it. If you want to use the non-www of your site place this into the .htaccess file of your www folder and your public_html folder: RewriteEngine on RewriteCond %{HTTP_HOST} !^sitename\.com RewriteRule ^.*$ http://sitename.com%{REQUEST_URI} [R=301,L] Code (markup): ****note: replace sitename with your site name, leave out the http:// and the www
Wow, great post! This explains why http://www.yourfamily1st.com/ has PR 4 (I always use that format in my linking) and http://yourfamily1st.com has PR 0!
Hi, I use in my web this .htacces RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\.hhdirecto\.net [NC] RewriteRule ^(.*) http://www.hhdirecto.net/$1 [L,R=301] Code (markup): It run ok, but when I have a folder with another .htacces it don't do anything. thanks
Use this ... RewriteEngine on RewriteCond %{HTTP_HOST} ^([^.]+\.com) [NC] RewriteRule (.*) http://www.%1/$1 [R=301,L] Code (markup): It will redirect any request for any page without the www to the corresponding page with the www.
I have tried it but when I go to hhdirecto.net/letras it redirect to www.hhdirecto.net//www/h/h/hhdirecto.net/htdocs/letras
Who's post are you replying too? I should have added that you should place the .htaccess file in your web root (the folder which holds all of your web pages).