.htaccess file to change from www to none

Discussion in 'Apache' started by Hades, May 30, 2007.

  1. #1
    Hey, I hope someone can help me. I want to write an .htaccess file that will allow people who go to my site, www.myspacepass.info to be redirected to simply myspacepass.info without the WWW. Is there a way to do it. I know there is a way to have the www added, but don't know if you can do it the other way.


    Nick
     
    Hades, May 30, 2007 IP
  2. jazz7620

    jazz7620 Banned

    Messages:
    357
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
    RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

    It only works on apache webserver though. Replace domain.com with your domain name.
     
    jazz7620, May 30, 2007 IP
  3. stugs

    stugs Peon

    Messages:
    157
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    zomg I remember that site :)
     
    stugs, Jun 1, 2007 IP