No www with subdomains

I’m using htaccess to redirect to when it’s written

But I need not to have www when it’s in subdirectory. For example if I’m in, it should redirect to

How I can do that?

Do you expect anyone would ever type [noparse][/noparse] anyway? “www” is a subdomain like “blog”, so it’s unlikely that anyone would type them both.

Anyhow, I have a subdomain on my site, and if I type “www.” before it the browser just goes to the subdomain anyway. Perhaps that’s because I redirect “www” to the non-www version for the domain name anyway.

Just to clarify, do you prefer your site to show “www” in the address or not?

I need to have it two types.
if no subdomain, I need to have,
but with subdomain no www, just


Have you looked at the sample code section of my signature’s tutorial? Have you looked at the sticky threads for this board? It’s all there (except your domain name)!