http://domain.com to http://www.domain.com ? - Postet den (4118 Views)
Senior Member
weeweeslap
Innlegg: 1077
1077
I run a dedicated server and for one of my domains I wish to redirect anyone that goes to http://DomainName.com to http://www.DomainName.com
How can I accomplish this? I appreciate your help. Thank you. -Oscar<
   
 Sidestørrelse 
Postet den
Forum Admin
HuwR
Innlegg: 20611
20611
just add both domains to your hostheaders, no need to do redirection for that<
Postet den
Senior Member
weeweeslap
Innlegg: 1077
1077
I have both in the host header. I just don't want them going to the non www part. Like say if you go to http://yahoo.com it automatically switches you to http://www.yahoo.com
That's what I want to do smile<
Postet den
Senior Member
leatherlips
Innlegg: 1838
1838
You could add this in the <body> of your page. I don't know if it's the best way but it will work.
Code:
<script Language="JavaScript">
location.href= ('http://www.DomainName.com');
</script>
<
Postet den
Forum Admin
HuwR
Innlegg: 20611
20611
ok, est way is to set up a website for http://domain.com on its own and then redirect it to the other website (should be an option in IIS) this will then appear to the search engines as a legitimate 301 redirect, leatherlips suggestion would appear as a 302 redirect which can cause problems for SEO.
personally I would leave it as it is, why do yo need to redirect ? makes no odds to me or search engines whether to use one or the other<
Postet den
Senior Member
bobby131313
Innlegg: 1163
1163
makes no odds to me or search engines whether to use one or the other

But if both get used and indexed it can hurt you bad. It will dilute your search engine weight. Google allows you to set it now in Webmaster tools so that they will automagically convert all your weight to your choice, but the others don't, your on your own.
I have been fighting this with my forum for years and can't fix it.
Go to....
http://www.coincommunity.com/forum/ >> PR3 http://www.coincommunity.com/forum/default.asp >> PR2
Same freakin' page indexed under 2 different names, splitting PR and more importantly backlinks..... and hurting me. I went through my forum code and changes hundreds of redirects from "default.asp", still can't get them consolidated. The problem seems to be solved here, I've asked a few times how, but no one has answered that I know of. sad
The OP's scenario can hurt the exact same way.<
Postet den
Forum Admin
HuwR
Innlegg: 20611
20611
But if both get used and indexed it can hurt you bad
No it won't all search engines treat www.domain.com/page.ext the same as domain.com/page.ext so long as they contain the same content, it makes no difference. www.domain.com/forum/ is not a page which is why you get problems with search indexing, it is a totally different issue<
Postet den
Forum Admin
HuwR
Innlegg: 20611
20611
sorry should have explained better, when your request for http://www.coincommunity.com/forum/ comes in, the webserver has to decide what to do, so it looks for the first available default page and redirects the browser to that it does so using a 302, that is a different issue to the one being discussed.<
Postet den
Forum Admin
HuwR
Innlegg: 20611
20611
bobby131313, you could try this for a solution, don't know if it will work, but it might.
1) remove default.asp from the list of default files for the website, and make sure you have no other index.hem files etc, so if you tried to open /forum/ you will get an error, probably directory listing denied or something. 2) now create a custom error page to handle that error, and use that file to rewrite the headers and do a 301 redirect to default.asp

might be worth a try if you have control over IIS<
Postet den
Senior Member
weeweeslap
Innlegg: 1077
1077
Yeah that's what I wanted to prevent, SE's indexing both www and non www of the same site. Prevent penalties of duplicate content. I also use domain.com/folder/ etc for my listings on the website I wanted to do. I'll try and do what you said Huwr, I am not sure but I'll dig in there. Thanks!<
Postet den
Senior Member
bobby131313
Innlegg: 1163
1163
No it won't all search engines treat www.domain.com/page.ext the same as domain.com/page.ext so long as they contain the same content, it makes no difference.

Sorry HuwR, but that's simply incorrect. That's exactly why Google lets you set it on the backend now. Because Gbot will index them as separate pages, I've seen them separate on sites with different PRs.
Thanks for the forum tip, I'll try it tomorrow and see what happens.<
Du må legge inn en melding