Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    156
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,742
    Likes Received:
    77
    Trophy Points:
    353
    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]
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice