Forum Moderators: open
Is there a different way to redirect so I wouldn't get hit twice?
Using:
RewriteCond %{HTTP_HOST}!www.*
RewriteRule (.*) http://www.%{HTTP_HOST}$1 [R=permanent,L]
I have never thought that I would be penalized for having the same content on widgets.com and www.widgets.com. Shouldn't Google be smarter then that? It can't figure out they are suppose to be the same?
Why should every webmaster have to go thru this redirection, but Google cant change their methods of penalizing?
Very wierd.
ohh... BTW... Do we need to redirect www.domain.com to www.domain.com/index.html since they are duplicates?
Please GoogleGuy let us know what the deal is? Or a different way to redirect, so we wouldn't get hit twice.
Thanks
You won't get penalized for it. You'll just loose one of the two sites' listings at google. Usually it's the one with the lowest pr / the lowest back link count. Allthough the content might be the same it *could* be different. Both are seen and treated as different domains. One using the hostname www and one without such a hostname.
>Please GoogleGuy let us know what the deal is
No need to call GoogleGuy - it's been discussed and clarified (also by GoogleGuy) here at WebmasterWorld a zillion times.
Search Google > Webmasterworld
redirect www non-www [google.com]
redirect www.widgets.com widgets.com [google.com]
redirect trailing slash [google.com]
domain.com/index.htm vs domain.com [google.com]
Allthough your personal server's config might be different, that's the standard apache behaviour. I suggest reading through the above posted threads to get deeper insights and clues as well as brilliant tips from past posts.
[edited by: Yidaki at 9:48 pm (utc) on Dec. 4, 2003]
I eventually did it like this - I said to my hosts: I want a 301 permanent redirect from non-www to www. They said they couldn't do it.
So I said, then get the NOC to do it.
They did it.
The 301 is now in place.
You're paying these people - tell them what you want, give them reasonable time, and then insist upon it.
They're supposed to be the experts, and they know their settings.
Welcome to WebmasterWorld [webmasterworld.com]!
> I was thinking if i should redirect www.domain.com/ to www.domain.com/index.html
I wouldn't do that -- What if you decide to change your site to php in a year or two?
Instead, change the name of your index file to "index.htm" or "main.html" - anything except "index.html". Next, use a DirectoryIndex directive to tell Apache you changed it. This will prevent a recursive loop from the following step. Finally, redirect "www.domain.com/index.html" and "domain.com/index.html" to "www.domain/"
And just as importantly, get as many of those links to "index.html" changed to "/" or removed as you can.
This is not really a critical problem, but standardizing on one way to access pages on your site now is a good investment in preventing bigger problems in the future.
Jim
>Instead, change the name of your index file to "index.htm" or "main.html" - anything except "index.html".
>Finally, redirect "www.domain.com/index.html" and "domain.com/index.html" to "www.domain/"
ok.. but then do i need to redirect www.domain.com/index.htm www.domain.com/?
In my understanding I would need to redirect domain.com & www.domain.com/index.htm to www.domain.com. right?
thanks
' Finally, redirect "www.domain.com/index.html" and "domain.com/index.html" to "www.domain.com/" '
Don't mention "index.htm" at all, except in the DirectoryIndex index.htm directive. Then, use that as as your home page filename to upload to. In the future, don't link to anything but "/" or "www.domain.com/", and try to get the old links updated. In other words, your index page has no publicly-know filename, only "/".
Internally, you can use any name you like, except for the old "index.html" name -- as long as you specify it in the DirectoryIndex directive.
You end up with this:
domain.com ------------------301--> www.domain.com/
domain.com/ -----------------301--> www.domain.com/
domain.com/index.html -------301--> www.domain.com/
www.domain.com --server auto 301--> www.domain.com/
www.domain.com/index.html ---301--> www.domain.com/
Finally, DirectoryIndex maps requests for www.domain.com/ to www.domain.com/index.htm internally.
You can't use "index.html" for the filename, because that would cause an "infinite loop" if an old "index.html" link was followed, as stepping through the above redirects will illustrate.
Jim