http:// vs. http://www.

I was curious as if to why Google automatically redirects you to the www.google.com if you type in google.com because my site does not do that. What is Google, Yahoo, AOL, and other companies doing to make sure users always are at the www. one? I honestly don't like seeing my domain name without the www., so is there a way to make it always www. if the users type in louiemantia.com, so that it redirects to www.louiemantia.com for example?

Thanks.

// Lou

#233578

Ugh, I hate that! There are some really professional sites that have overlooked this, and the site doesn't work unless you add www.

See if doing a Javascript redirect would fix your problem.

-NC

[Edit: PS: I think there is another better way, but I'm not sure.]

#233581

Who did your register your domain with? In my domain settings, I got a url redirect. So I can easily make sure that mindsofintelligence.com goes to www.mindsofintelligence.com.

So my bet is check if your domain registrar supports url redirection.

#233582

Ugh, I hate that! There are some really professional sites that have overlooked this, and the site doesn't work unless you add www.

See if doing a Javascript redirect would fix your problem.

-NC

[Edit: PS: I think there is another better way, but I'm not sure.]

Can you explain what you mean by a javascript redirect?

// Lou

#233583

guessing a javascript that reloads the page automatically but to a www. url so www. appears

-bolero

#233584

c

guessing a javascript that reloads the page automatically but to a www. url so www. appears

-bolero

and could you help me out on how to make a javascript refresh script thingadoo? do you know? does someone know? :P

// Lou

#233586

google is your friend ;)

hehehe

i dont know personally but im sure others here can help you

-bolero

#233587

booya, i got it, if you put

<meta http-equiv="refresh" content="0; url=http://www.domainname.com/">

it will redirect :D

ut oh, now it redirects every second!!! ahh! how do i make it redirect only once?

// Lou

#233589

bolero summed it up perfectly. Off the top of my head, I don't remember how the JS redirect goes...I just use Google.

Try typing in Javascript redirect. Should work well :)

-NC

P.S: Yeah, URL forwarding also works.

#233590

Google isn't doing a redirect at all.

What Google does is altering the header information it returns.

Oh, and you shouldn't use redirects - they break the URL for lots of people, and if a user types a URL, then you have no right (IMHO) to redirect them elsewhere unless you know what you're doing. Which - and this sounds very rude and big-headed, but isn't meant to - you don't.

Also, munging the headers á la Google is not the same as redirecting - it doesn't affect what the user's doing (or their history/back button), whereas meta-refresh usually does, as does window.location. Also, these are easy to switch off, meaning that the user gets a blank page (or a page that's one more link to your content, so they'll go elsewhere)

#233592

I knew Stevie would come along and prove me wrong. How do you alter the header information a la Google anyway?

#233594

It's setting made to the CNAME or A record on the name server (DNS server) that is the record authority for that particular domain. It can be global or limited to a particular record. Don't remember which off the top of my head.

Larger sites do it to maintain uniformity in sub-domain naming conventions.

To put it bluntly, leading an internet dns record with www is cosmetics.

Some of our customers request it, most don't care either way.

#233595

I used a server before where there was a www folder that was a shortcut kinda to the public_html folder.

#233596

http:// is the root of the domain, www is a folder inside the root. www therefore is not necessary. It's customary, because you may want to provide multiple services at your domain. Remember, the web isn't the only part of the internet. Often you have ftp.foo.com, mail.foo.com, etc. www.foo.com would be the website, accordingly.

I just make sure both work.

#233598

I knew Stevie would come along and prove me wrong. How do you alter the header information a la Google anyway?

It depends.

I don't know how to do it on *nix, and in plain-Jane IIS, it's messy, but in ASP.Net/JSP, you do it through methods and properties of the Response object (Response.Headers collection in .Net, something similar in Java I guess?). Aside from those, I couldn't recall without checking.

#233605

http:// is the root of the domain, www is a folder inside the root. www therefore is not necessary. It's customary, because you may want to provide multiple services at your domain. Remember, the web isn't the only part of the internet. Often you have ftp.foo.com, mail.foo.com, etc. www.foo.com would be the website, accordingly.

I just make sure both work.

See, but what I WANT is to make it so that the root redirects to www.louiemantia.com, because i dont offer any other services on my domain, no other subdomains or anything either.

So is there a way that I can do it?

// Lou

#233612

See, but what I WANT is to make it so that the root redirects to www.louiemantia.com, because i dont offer any other services on my domain, no other subdomains or anything either.

So is there a way that I can do it?

Well, I redirect www to the root. So I just symlinked www to public_html. Works great. I don't know how you'd do it on Windows.

#233619