# why is having no redirect between domain.com and www.domain.com wrong?

I was told that using domain.com and www.domain.com at the same time is wrong and, to cite the answer "You will end up with all sorts of problems".

What kind of problems are those? The thing is the new company I work for does the same mistake and I'd like to explain them it's wrong and why but for now facebook login (which they don't use) and google analytics statistics mess I had to fix (4k selfreferrals a day) are the only reasons I know.

-

## migrated from stackoverflow.comDec 21 '11 at 11:50

This question came from our site for professional and enthusiast programmers.

Cookies are split and/or duplicated. SSL doesn't work. Inbound links aren't consistent

The main thing to understand is that although www.domain.com and domain.com may display the same site, they don't have to, so are treated as separate sites.

In detail

Your users will end up with cookies for the domain.com and www.domain.com which may be different, depending on what you store in them. So, for example, if your website displays different content according to what's in the cookie then they'll see different things according to whether they're using www.domain.com or domain.com to access your site.

SSL doesn't work.

I think they mean, if you have an SSL certificate for domain.com then if people use www.domain.com then that certificate won't work (you'll have to get another one, or pay more for a wildcard one).

This is all true, but just to add, search engines are pretty smart with domain.com/page vs www.domain.com/page, especially when they contain the same content. You can set a preferred domain in Google Webmaster Tools if redirection is too much effort. –  DisgruntledGoat Dec 21 '11 at 23:39