Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jan 2009
    Posts
    15

    Default How to force WWW fort the whole server ?

    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. #2
    Member
    Join Date
    Apr 2009
    Posts
    6

    Default

    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
    PawBill: Billing and Automation System for web hosts

  3. #3
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,170
    cPanel/Enkompass Access Level

    Root Administrator

    Lightbulb

    Quote Originally Posted by Exa_Ankur View Post
    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
    That should work.

  4. #4
    Member
    Join Date
    Jan 2009
    Posts
    15

    Default

    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. #5
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    Quote Originally Posted by dotcom22 View Post
    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
    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

Similar Threads & Tags
Similar threads

  1. how to force site to open as www.site than http://site
    By pankajarya in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-11-2011, 12:12 AM
  2. Replies: 0
    Last Post: 05-20-2009, 09:49 AM
  3. Force www. on domain?
    By FarSerenade in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 09-27-2007, 12:07 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube