Forum Moderators: phranque

Message Too Old, No Replies

using www and non-www together

         

lokeshshettyk

5:34 am on Feb 4, 2009 (gmt 0)

10+ Year Member



Hi,
I have a site (http://sub.domain.com/) that's working fine. Now what I am trying to achieve is that [sub.domain.com...] should also work. So irrespective of whether user types in [sub.domain.com...] OR [sub.domain.com...] both should work. Please help

Cheers :)

Quadrille

7:58 am on Feb 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The best way to achieve this without user confusion or SEO damage, is to set up a 301 permanent redirect from www.sub.domain.com to sub.domain.com.

Exactly how to achieve this depends on your server type, but there's plenty of info around here on [301 permanent redirect]

lokeshshettyk

9:30 am on Feb 4, 2009 (gmt 0)

10+ Year Member



well, i do not want to redirect. All I want is user may type in www.sub.domain.com OR sub.domain.com he should be able to view the page.

Thanks

Quadrille

10:21 am on Feb 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I do not know of any other way. www.sub.domain.com is actually another, different subdomain to sub.domain.com, so - unless you set up the same content on both subdomains - you'll need a redirect.

Even without such duplication, you are at serious risk of duplicate content issues; if you set up the extra domain and consciously duplicate your content onto it, well, you are asking for trouble.

What's the objection to a plain old fashioned 301, which would allow the user to type in www.sub.domain.com OR sub.domain.com and be able to view the page?

[edited by: Quadrille at 10:22 am (utc) on Feb. 4, 2009]

lokeshshettyk

10:41 am on Feb 4, 2009 (gmt 0)

10+ Year Member



Hi, thanks for the response..

well, no objection at all to the old fashioned 301. I am very ok with this. Again what i want is when user types in www.sub.domain.com i do not want them to see sub.domain.com in the address bar it should stay as what they typed in www.sub..... or sub.....

Thanks :)

Quadrille

11:22 am on Feb 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That can't be done - you'd need to set up the extra subdomain at www.sub.domain.com and copy the site across.

My advice would stand - do the 301 - all the user would see different is the 'www' missing - which would neither hurt nor surprise them (if they noticed at all - most would not!).

If they did notice, you'd be doing them a favour, as they'd learn that they don't need to add the www.

Many argue that even domain.com does not need a 'www' - and technically, it doesn't - but convention is strongly pro-www

But for subdomains, not only do you NOT need it, it really does create hassle and extra work (as you've found!), and the convention is NOT to use it.

Life's complicated enough without looking for trouble - but it's your site ... ;)

lokeshshettyk

11:37 am on Feb 4, 2009 (gmt 0)

10+ Year Member



Hey, thanks a ton for your useful posts, i would slap this at my business team since they wanted this no matter what. Now since that's is not even possible, all i tell them is "take a hike"

Cheers :) and thanks a ton :)

g1smd

11:48 am on Feb 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



*** well, i do not want to redirect. ***

You absolutely DO need the redirect. To not have it means you effectively have two sites serving Duplicate Content.

*** All I want is user may type in www.sub.domain.com OR sub.domain.com he should be able to view the page. ***

That's exaxctly what the redirect is for. You ask for "A" and you get the content. You ask for "B", get redirected to "A" and get the content - without risk of "B" being indexed as a Duplicate URL.

Install a site-wide 301 redirect, one that preserves the requested file path within the redirect, and you'll be fine.

*** what i want is when user types in www.sub.domain.com i do not want them to see sub.domain.com in the address bar it should stay as what they typed in www.sub..... or sub..... ***

Can't be done. What you are proposing to do is the exact definition of what Duplicate Content is.

If they insist on this, then you need to make sure that every page when served via an alternative subdomain has a meta robots noindex, nofollow tag dynamically inserted into it for all variations of URL except for the one exact domain that you do wish to be spidered and indexed.