Page rank and http:// and http://www.

tekkitan

Forum Junkie
Joined
Aug 8, 2004
Messages
636
depends on what everyone is linking to. in my opinion, it's better with the www because just about everyone will think www when they type in a web site.

the reason it is different though, is because they are different addresses (obviously). it's just how Google PR works.
 

Joe

bikeforums.net
Joined
Jan 10, 2004
Messages
468
301 non www traffic to the www side of things, better SEO longterm.
 

Joe

bikeforums.net
Joined
Jan 10, 2004
Messages
468
thegunowner914 said:
Could you elaborate on that please?

Is that like how if you type in http://google.com it automatically redirects you to http://www.google.com

How do you do it? Why is it better? Info please! :)

Thank you kindly in advance.

Exactly

How you do it? Good question, somebody else can answer that one for ya, or google "301 redirect".

Why? You combine your page rank from two sites (domain.com and www.domain.com) into one, ultimatly will pass on more PR to your sub-pages, hence, better SEO.
 

Joe

bikeforums.net
Joined
Jan 10, 2004
Messages
468
Found it... you need mod_rewrite on to make this work, but create a .htaccess file, and put in this info after editing in your domain info:

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

I would support it, but dont know enough to help with any problems. Worst case? You have to remove the code from your .htaccess :)
 

quentin

Habitué
Joined
Feb 11, 2004
Messages
1,989
without mod_rewrite, in index.php:

PHP:
if($_SERVER['HTTP_HOST']=='example.com') {
   header("HTTP/1.1 301 Moved Permanently");
   header("Location: http://www.example.com/");
   header("Connection: close"); 
}
 

DChapman

Devotee
Joined
May 20, 2004
Messages
2,880
quentin said:
without mod_rewrite, in index.php:

PHP:
if($_SERVER['HTTP_HOST']=='example.com') {
   header("HTTP/1.1 301 Moved Permanently");
   header("Location: http://www.example.com/");
   header("Connection: close"); 
}

I'd certainly prefer to do it without mod_rewrite. Where exactly do I put this in index.php? I use vbadvanced CMPS so there isn't much in there. Thanks!
 

Joe

bikeforums.net
Joined
Jan 10, 2004
Messages
468
thegunowner914 said:
It combines the two? So if I have exchanged links with someone who has http://mysite.com I don't need to ask them to change it to http://www.mysite.com ?

Thanks for all your help!

Correct, the 301 redirect tells google that the page has permanently been moved from domain.com do www.domain.com. You should see all the PR show correctly on www.domain.com on the next update.

While using quentin's method will work for the index page, it wont work for any other pages on your site. The mod_rewrite change is site wide, but it really comes down to how people are linking to you, with or without the www, and if you feel comfortable using the mod_rewite code.
 

DChapman

Devotee
Joined
May 20, 2004
Messages
2,880
Joe said:
Correct, the 301 redirect tells google that the page has permanently been moved from domain.com do www.domain.com. You should see all the PR show correctly on www.domain.com on the next update.

While using quentin's method will work for the index page, it wont work for any other pages on your site. The mod_rewrite change is site wide, but it really comes down to how people are linking to you, with or without the www, and if you feel comfortable using the mod_rewite code.

I got the .htaccess working. Thank you for all your help, I really appreciate it.
 

The Sandman

Tazmanian Addict
Joined
Jan 1, 2004
Messages
29,165
Joe said:
Found it... you need mod_rewrite on to make this work, but create a .htaccess file, and put in this info after editing in your domain info:

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

I would support it, but dont know enough to help with any problems. Worst case? You have to remove the code from your .htaccess :)
Where do you put this, in the forum root directory or elsewhere?
 

DChapman

Devotee
Joined
May 20, 2004
Messages
2,880
The Sandman said:
Where do you put this, in the forum root directory or elsewhere?

I put it in my root directory, NOT my forum directory. I was wondering if you were going to implement this too :)
 

The Sandman

Tazmanian Addict
Joined
Jan 1, 2004
Messages
29,165
thegunowner914 said:
I put it in my root directory, NOT my forum directory. I was wondering if you were going to implement this too :)
Do you mean public_html directory or the directory that contains public_html?
 

DChapman

Devotee
Joined
May 20, 2004
Messages
2,880
The Sandman said:
Do you mean public_html directory or the directory that contains public_html?

In public_html

So the path to MY file would be home/xyz/public_html/.htaccess
 

tekkitan

Forum Junkie
Joined
Aug 8, 2004
Messages
636
are these supposed to acually redirect as well?

what if someone wants to 301 redirect from one domain to another? will these same things work?
 

tekkitan

Forum Junkie
Joined
Aug 8, 2004
Messages
636
rooshine said:
Thanks for the great tips.

I have a related question maybe some of you good folks can answer. I have different PR for www.mysite.com then for www.mysite.com/index.php (and also different for www.mysite.com/index.php?). Is there a way to merge these as well?

Thanks again for the great heads up.

yes i have that problem as well :(

mysite.com/ is PR4
mysite.com/index.php is PR3
mysite.com/index.php? and the rest of my forum is PR2
 

DChapman

Devotee
Joined
May 20, 2004
Messages
2,880
tekkitan said:
yes i have that problem as well :(

mysite.com/ is PR4
mysite.com/index.php is PR3
mysite.com/index.php? and the rest of my forum is PR2

Bump to see if anyone has any insight into this. I'm curious as well.
 
Top