The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirect Question

Discussion in 'General Discussion' started by br3ach, Jan 25, 2005.

  1. br3ach

    br3ach Active Member

    Joined:
    Feb 21, 2004
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    UK
    Can anyone tell me if it is possible to force all requests sent to

    http://www.site.com/
    or
    www.site.com

    to redirect to

    http://site.com/

    so there is never "www." included in the domain name?

    I have root access to the server so can edit anything required.

    Can someone please help out by posting a brief guide on what I need to do?

    Thanks
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    Put the text below in your .htaccess file


    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www.site.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.site.com$
    RewriteRule ^(.*)$ http://site.com/ [R=301,L]
     
Loading...

Share This Page