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.

How to force WWW fort the whole server ?

Discussion in 'General Discussion' started by dotcom22, Sep 8, 2009.

  1. dotcom22

    dotcom22 Member

    Joined:
    Jan 1, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Hello

    I use WHM/Cpanel and I would like force WWW for all present and future account of my VPS... Actually for do that I use a single htaccess with this rule:

    #--------------------------------
    # FORCE WWW access:
    #--------------------------------
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^[^.]*.[^.]*$
    RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R,L]

    ...and it work well...anyway is not possible to apply this rules somewhere for take effect for the whole server instead set this for each account ??

    thank
     
  2. Exa_Ankur

    Exa_Ankur Member

    Joined:
    Apr 22, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    I think the "Skeleton Directory" files are copied to each new account created by default.
    Did you try including a .htaccess file for this in the skeleton directory so that all new accounts have this applied automatically ?
    I haven't tried it, o not sure if it will work
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,472
    Likes Received:
    200
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    That should work. ;)
     
  4. dotcom22

    dotcom22 Member

    Joined:
    Jan 1, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    ok tank for suggestions....Skeleton are not exactly a solution for me...I thinking it was possible to set something for the whole server...without worry to set this in htaccess and maybe increase little bit the server load...More rule inside the htaccess and more load...

    cheer
     
  5. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Fine! Put your .htaccess lines in the <Directory /> section of your /usr/local/apache/conf/httpd.conf file and run the Distiller script (see top header of that same file for information) and then restart Apache (service httpd restart).

    That will enable this for the whole server.

    Make sure your redirect is generalized and not specific to any domain
     
Loading...

Share This Page