1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.htaccess for sub domain {please help}

Discussion in 'White Hat SEO' started by bleach, Oct 7, 2010.

  1. bleach

    bleach Senior Member

    Joined:
    Oct 12, 2008
    Messages:
    934
    Likes Received:
    82
    Location:
    New York
    i want to redirect from www to non www for subdomain
    i tried to using .htaccess. is it correct ?
    please help me
    PHP:
    # BEGIN Wordpress

    RewriteEngine On
    RewriteCond 
    %{HTTP_HOST} ^www\\.(.+)$
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    # END Wordpress
     
  2. xboxps3wow

    xboxps3wow Power Member

    Joined:
    Jan 15, 2010
    Messages:
    737
    Likes Received:
    239
    Occupation:
    student
    Location:
    Chicago
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.example.com
    RewriteRule (.*) http://example.com/$1 [R=301,L]


    (the one you posted should work as well, as far as i know)
     
  3. bleach

    bleach Senior Member

    Joined:
    Oct 12, 2008
    Messages:
    934
    Likes Received:
    82
    Location:
    New York
    thanks dude
    but its for main domain not for subdomain