SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast edgarzakaryan's Avatar
    Join Date
    Aug 2012
    Location
    Yerevan, Armenia
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    no www with subdomains

    Hello.
    I'm using htaccess to redirect to www.mysite.com when it's written mysite.com.

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

    How I can do that?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,120
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Do you expect anyone would ever type www.blog.mysite.com 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?
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Enthusiast edgarzakaryan's Avatar
    Join Date
    Aug 2012
    Location
    Yerevan, Armenia
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Do you expect anyone would ever type www.blog.mysite.com 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 www.mysite.com,
    but with subdomain no www, just blog.mysite.com

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,645
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    edgar,

    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)!

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •