In my opinion you should not edit config files which are managed by I-MSCP. You can edit parts of the config using the /etc/apache2/imscp/*.conf files (they are loaded by the main config file for each (sub-)domain).
If you want to redirect the best would be to be sure to use I-MSCP v1.3.0 or newer because the HSTS feature is implemented now and can be activated (https://i-mscp.net/index.php/T…57-i-MSCP-1-3-0-RELEASED/)
For the admin panel redirection I personally do the following (in this example the admin interface can be reached using https://admin.domain.tld:4443
- I create the domain "domain.tld" inside I-MSCP
- Adding subdomaind "admin.domain.tld"
- Enabling SSL for the subdomain
- Placing an .htaccess file which redirects all requests to port 4443 (normal redirect)
.htaccess file:
- RewriteEngine On
- RewriteRule (.*) https://%{HTTP_HOST}:8443%{REQUEST_URI}
Benefits (for me):
I do not like the admin interface proxy plugin - so I do not have to use it.