A must do to improve your website’s page rank
For anyone that hasn’t already heard me ramble on about page ranks, it’s a number that Google assigns to your website based upon the amount of incoming/outgoing links, search engine optimization, and traffic. The higher the score, on a scale of 1-10, the more various ad networks will pay you.
Quite a few of us in the Forum hop on over to a page rank checker every month or so in hopes of a boost in our rank. You can check your current number at a site like PageRank Checker.
What you may notice is that your URL with and without the www. can have different page ranks. This is because some people may have forgotten to include the www. when linking to your site, or they copied and pasted exactly what was in the address bar in their browser.
If you were to visit a couple of our member’s websites, you’d notice that it doesn’t automatically include the www. if you don’t type it (Aaron’s BlackRock’s Business Ideas and Kevin’s KMull.com for example). Whereas, another young go getter’s site, Kineda, does automatically do it.
So how did Terry at Kineda get this to work? Quite simply.
1. Open up notepad or your simple web editor of choice.
2. Paste the following into it:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourwebsite.com [NC]
RewriteRule ^(.*)$ http://www.yourwebsite.com/$1 [L,R=301]
3. Replace “yourwebsite” with your website’s URL, obviously.
4. Save this file as “.htaccess”. Don’t include a txt or html file extension. Just “.htaccess”.
5. Upload this to the root directory of your webhost’s server. May be /www or /httpdocs. Wherever your main index file for your website is located.
6. That’s it! Try visiting your website without the www. and you should automatically be forwarded to the one with.
In some instances, you may already have an .htaccess file in your root folder and be prompted to replace it when you upload the new one. DON’T REPLACE IT. Download the current one from your server, open it in a text editor, and add the code above to the bottom of the file. You may have other functions set for your server that are necessary, so don’t delete an existing .htaccess file, just add to it.
This is one of the first things you should do with every new website or blog you launch. For the two minutes it takes, you can save yourself a lot of worry down the road when your website without the www. has a better rank than with. And I’ll admit it, up until reminding myself with this post, YGG has paid the price of not following this tutorial. Lesson learned.
July 9th, 2007 at 2:41 pm
Great tip Travis! I will have to take care of this when I get home!
July 9th, 2007 at 4:43 pm
Good point, but I disagree with using the “www” prefix. It has been depreciated for years.
I’ve configured my htaccess to automatically remove the “www” from my URLs. This is how.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
July 9th, 2007 at 5:35 pm
Good point Noel. If your URL without the www. is in better shape than with, forwarding to the opposite of what I said is your best strategy.
July 9th, 2007 at 7:10 pm
Did you just do that for YGG this afternoon? I never noticed it doing that before.
July 9th, 2007 at 7:13 pm
Yes. A little before putting this post live, I made the change to YGG.
July 9th, 2007 at 11:07 pm
The www or not www debate is interesting. I’ve seen way too many people add www. to a domain name (amateur users) to consider not using it. Lots of people try to put the www’s on a subdomain which as we know doesn’t work.
The debate is nice, but I don’t think most users care which you choose :)
July 10th, 2007 at 12:23 am
Sweet! I’ve been thinking about doing this for a while but never got around to looking for the right rewrite syntax.
I’ve always been a strong supporter of the www prefix. Call me anal but the prefix gives the URL some symmetry. However, with my current site, I made a “bold” move - I opted to remove the www. I think I’m a changed man.
Just another way to brand your domain!
July 10th, 2007 at 5:25 am
Just a note that if you’re going to use the /htaccess file remember it only works on Apache. Any Microsoft people using IIS, this won’t work for you.
Good tip though for Apache (PHP) people.
July 10th, 2007 at 8:14 am
If you are using subdomains like yg2.yourwebsite.com and yg2.yourwebsite.com.
Can you rewrite only if the www is empty? ie. only yourwebsite.com would get pushed to http://www.yourwebsite.com or is there a better solution?
July 10th, 2007 at 10:24 am
Oooo called me out now, didn’t you? :) Changed!
July 10th, 2007 at 9:47 pm
Thanks so much for the great tip. You win a minor distinction with this great article (ok, really minor, but still.) I’ve been blogging for only about a week, and you are the first post that I’ve linked to from my own blog!
your badge of honor post is here.
Thanks again for the great info.
July 11th, 2007 at 7:00 pm
Nice article Travis… I didn’t even realize you used Kineda as an example, until I read deeper. :)
July 12th, 2007 at 10:42 pm
Urm, it doesn’t work if I’m typing directly to a directory path?
Sure, if I typed dannyfoo.com it does include the www prefix for me. However, I noticed if I typed dannyfoo.com/blog/ it doesn’t add the www for me.
Anything I’m doing wrong or something in htaccess preventing this?
July 13th, 2007 at 12:11 pm
How to brand your website’s URL, Part 1: to www or not to www?…
Your website is no stranger to branding, and the same should apply for its URL. Here’s Part 1 of How to brand your website’s URL: to www or not to www?
……
July 19th, 2007 at 10:16 am
In response to Danny Foo’s comment, I encountered the same thing when adding it to my site. It actually occurs hereat YGG, too (try http://younggogetter.com/about/).
In your instructions, you state that these rules should come AFTER everything else. It actually makes more sense to put them before, because any other rules you may have (like in WordPress) need to take effect after the domain rewriting. By adding the “www.” after my WP rules, everything works as expected.
July 19th, 2007 at 4:45 pm
Thanks Lance. Great fix.
I hadn’t noticed it not working for pages. Moving the redirect to the top of the document, so it doesn’t conflict with WP rules, does the job, as you said.
Thanks again.
March 24th, 2008 at 10:03 pm
transmit malpublication araguato measles extrabuccal chrysographer gunlock silicoflagellata
Irish Nutrition & Dietetic Institute
http://www.judyberg.com/
April 19th, 2008 at 1:08 pm
transmit malpublication araguato measles extrabuccal chrysographer gunlock silicoflagellata
The Weather Channel - Elberton, Georgia
http://www.charleswebbcidesigns.com/