I have been reading through this forum and this is my first post here, I'd like to say hi. Anyways, I found this code for getting www.domain.com -> domain.com: But I want to do this: domain.com -> www.domain.com I tried playing around with it, no luck, I thought I would ask other members as they seem very helpful from the threads I have gone through. Thanks for you help.
Hi, Here's a possible solution using PHP: It's basically saying that if the host address is domain.com then it will redirect to www.domain.com Hope I could help.
This will do what you describe: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301] Code (markup):
RewriteCond %{HTTP_HOST} !^www RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R] I use this way and works great too
good .htaccess code ResaleBroker some time you see following problem with PR : 1) domain.com PR0 2) www.domain.com PR4 above problem can be solved by following .htaccess code ----------- RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301] ---------------- I do not prefer to use PHP code for redirection mainly that process will help for ( URLs - Relative Vs. Absolute )
No. A PR4 + a PR2 does not equal a PR6 when you're talking about PR. Since PR is based on a logarithmic scale, a 2 + 4 doesn't equal 6. a PR 5 if you're lucky, but I highly doubt that it could raise up to a PR6. The main benefit that I can see is preventing duplicate content.
Google has both with and without the www indexed for me. Both have the same page rank but one has more pages listed. I am wondering if this is hurting my site as being duplicate content. If I used the codes above would there be an advantage to having www point to the one without or the other way around? Would the one with the most pages indexed automatically be the best one to have the other one point to? Thanks, Carol