Forum Moderators: open

Message Too Old, No Replies

widgets.com --> www.widgets.com --> www.widgets.com/index.html?

Why do we need to do this?

         

overdrive

9:07 pm on Dec 4, 2003 (gmt 0)

10+ Year Member


After I redirected my sites, it looks like its getting hit twice and slowing down the server.

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

Yidaki

9:35 pm on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>penalized for having the same content on widgets.com and www.widgets.com

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]


Btw, it's a standard apache set up that www.domain.com gets redirected to www.domain.com/. After getting redirected to www.domain.com/ apache uses your default page settings (httpconf) to serve either index.htm or default.htm or home.htm or whatever you configured as default directory index page. So usually there's no need to htaccess to index.htm.

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]

superscript

9:48 pm on Dec 4, 2003 (gmt 0)



There have been endless posts on this subject - but this is not your fault. They always end up in endless technical threads explaining how to do a 301 permanent re-direct from non-www to www. But then more and more posters enter the game, and it turns out the code doesn't work, incorrect code is posted, corrections to the code are posted etc. etc.

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.

overdrive

11:04 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



I have already redirected all my sites from domain.com/ to www.domain.com/. And I know that apache automatically redirects all that. I just dont want to get penalized for having the same page for www.domain.com/ and www.domain.com/index.html. I was thinking if i should redirect www.domain.com/ to www.domain.com/index.html. Also all these redirection is putting a load on the server. The same page gets hit twice in the log files.

jdMorgan

11:19 pm on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



overdrive,

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

overdrive

12:06 am on Dec 5, 2003 (gmt 0)

10+ Year Member



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

jdMorgan

12:46 am on Dec 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oops, typing too fast... Make that:

' 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