How would I redirect www to non www addresses?

Discussion in 'Domains, Hosting and Servers' started by cheat-master30, Feb 24, 2010.

  1. cheat-master30

    cheat-master30 Grand Master

    Joined:
    Jul 30, 2009
    Messages:
    789
    Likes Received:
    59
    I want to know what code I need to add this to my site's .htaccess file. Thanks.
     
  2. Yoshi

    Yoshi Regular Member

    Joined:
    Jun 9, 2005
    Messages:
    219
    Likes Received:
    11
    Location:
    UK
    Code:
     [COLOR=#00007F]RewriteEngine[/COLOR] [COLOR=#0000FF]On[/COLOR]
    [COLOR=#00007F]RewriteCond[/COLOR] %{HTTP_HOST} ^example\.com$ [NC]
    [COLOR=#00007F]RewriteRule[/COLOR] ^(.*)$ http://www.[COLOR=#00007F]example[/COLOR].com/$[COLOR=#FF0000]1[/COLOR] [R=[COLOR=#FF0000]301[/COLOR],L] 
    
     
    2 people like this.
  3. cheat-master30

    cheat-master30 Grand Master

    Joined:
    Jul 30, 2009
    Messages:
    789
    Likes Received:
    59
    Thank you.
     
  4. H Potter

    H Potter Gruv

    Joined:
    Feb 7, 2012
    Messages:
    11
    Likes Received:
    0
    Thank you too!
     

Share This Page