+ Reply to Thread
Results 1 to 11 of 11

Thread: PageRank Traffic Tip

  1. #1
    Web Junky Matt is on a distinguished road
    Join Date
    Dec 2003
    Posts
    71

    PageRank Traffic Tip

    Funneling PageRank from root domain to www. using Mod_ReWrite

    The Problem

    When building PageRank you may encounter someone who links to your domain as domain.com and someone else links to a page with www.domain.com. The trouble is, Google will not see these as the same page but rather two separate pagenames named domain.com/pagename.html and www.domain.com/pagename.html respectively. Consequently, each of these pages will have different PageRank. This could curtail your SEO efforts.

    The Solution

    You use mod_rewrite to rename the pages automatically when visited by either spider or human. This will funnel your PageRank to the correct page, either www. or without, your choice.

    Requirements

    - Fair level of internet expertise, at least with FTP.
    - Admin access to the domain
    - Apache WebServer.
    - Mod-rewrite. Ask your webhost if its installed. Many don't have it on by default.
    - .htaccess. Again ask your webhost if you're not sure. They may have to change their Virtual Host setting to AllowOveride.

    First make a backup of .htaccess if one exists. If it doesn't exist, copy and paste the following code:

    This is a mod_rewrite rule that will change your pagenames. You can make a fatal error and crash your website with this technique, so make sure you have a backup of .htaccess if there was one, or the ability to quickly delete the one you add, if necessary.
    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.domain\.com
    rewriterule (.*) http://www.domain.com/$1 [R=permanent,L]
    You should be able to copy and paste this example after changing domain.com to your domain name.

    Hit refresh in your browser. You should now be able to enter www.domain.com or domain.com in your browser and be brought to the correct page. You will see the URL change in your address bar due to the rewrite!
    WebmasterLingo.com Team
    Forum Rules

    "Anyone who has never made a mistake has never tried anything new" - Albert Einstein

  2. #2
    Full Member tomcromp is on a distinguished road
    Join Date
    Mar 2004
    Location
    London
    Posts
    32
    can you give a little better explation on what t do with the code?

    Cheers
    tom

  3. #3
    Web Junky Matt is on a distinguished road
    Join Date
    Dec 2003
    Posts
    71
    Sure,
    You find the .htaccess file on your server, you open it up and add the code above into that file (also, change the urls respectively).

    I hope this helps!
    WebmasterLingo.com Team
    Forum Rules

    "Anyone who has never made a mistake has never tried anything new" - Albert Einstein

  4. #4
    Full Member tomcromp is on a distinguished road
    Join Date
    Mar 2004
    Location
    London
    Posts
    32
    so for www.happywebmasters.com i would add this code:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.happywebmasters\.com
    rewriterule (.*) http://www.happywebmasters.com/$1 [R=permanent,L]

  5. #5
    Full Member tomcromp is on a distinguished road
    Join Date
    Mar 2004
    Location
    London
    Posts
    32
    $1 what does that do in the code?

  6. #6
    Web Junky Matt is on a distinguished road
    Join Date
    Dec 2003
    Posts
    71
    It's just a variable for the remainder of the called url, after the domain name.

  7. #7
    Full Member Marshall is on a distinguished road
    Join Date
    May 2004
    Posts
    69
    Thank you! I didnt know about this till now, now I wont have 2 different PR's for my website.

  8. #8
    Matt, This is a great solution in theory. I say in theory because I haven't tried it yet but will be doing so.

    I've racked my brain for hours trying to figure out a way to get rid of domain.com. This looks like it will work. Do you have any data proving this works? Any bit will help.

    Thanks for the tip.
    Coltura Creativa: Create.Critique.Conquer
    Articles & Reviews

  9. #9
    Full Member mdbriggs is on a distinguished road
    Join Date
    Jan 2004
    Location
    Lexington, KY
    Posts
    17
    so if i wanted to go the opisite way here and have it redir to the non www site it should look something like this?

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.mdbriggs\.com
    rewriterule (.*) http://mdbriggs.com/$1 [R=permanent,L]

    just want to make sure i'm getting this right before intergrate it.

  10. #10
    Newbie Big Bill is on a distinguished road
    Join Date
    Feb 2005
    Location
    surrey
    Posts
    2
    What's wrong with a 301? Bit quicker, no?

    BB

  11. #11
    Full Member ursimrankhanna is on a distinguished road
    Join Date
    Jul 2010
    Posts
    9

    PageRank Traffic Tip

    Hi,
    thx for such a nice posting which is very use full.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts