.htaccess create behaviour

  • With the help of Ninos I managed to get kind of what I wanted to :)


    By editing the file /etc/imscp/apache/parts/custom.conf.tpl


    Code: /etc/imscp/apache/parts/custom.conf.tpl
    1. # SECTION HTACCESS
    2. <Location />
    3. AuthType Basic
    4. AuthName "xxxx"
    5. AuthUserFile {HOME_DIR}/.htpasswd
    6. AuthGroupFile {HOME_DIR}/.htgroup
    7. require valid-user
    8. </Location>

    I achieved the following:



    When a new Domain/Subdomain is created, the htaccess information is automatically created and linked via vhost definition. i-mscp automatically creates a file <domainname>.conf under the directory /etc/apache2/imscp with the above content. So I am able to manage a domain and all of the subdomains via one htpasswd and htaccess file and I don´t have to do that manually. Good thing about that, even it may not be the best solution after all, the custom.conf.tpl won´t be touched ("Any changes made to this file will be preserved on update."). so I don´t have to change that all the time.


    I have to say, this is a solution specific for our development server, I would not recommend doing this on a production server!