Redirect http to https by using .htaccess
- UncleSam
- Closed
-
-
better use:
this redirect regardless www...port...ipas .htacces overall will slow down allways the best way is to
implement it to the v-host conf. file with a:
RedirectPermanent / https://example.com/ -
-
Yes this is a better way i replace now all my .htaccess redirects and update my first post THANKS!
-
try to avoid .htaccess...i know it is very popular but it is(allways has been) a performance killer
-
-
Better is to use this:
http://forum.i-mscp.net/Thread…direct-from-HTTP-to-HTTPSR=301: Permanenter Redirect
L=cancel this rewrite after using this rule -
grep -i rewrite /etc/apache2/sites-available/00_master.conf
In my installation there is no /etc/apache2/sites-available/00_master.conf. Guess there have been some changes since then.
Where would now be the place to achieve a permanent http -> https, ideally one that survives an update?
Cheers
Chris -
-
push - couse same here.
-
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:
Benefits (for me):
I do not like the admin interface proxy plugin - so I do not have to use it. -
-
With 1.3.0 you can just activate HSTS feature
-
With 1.3.0 you can just activate HSTS feature
Maybe I am blind ... but where do I find this feature?
Forget my post ... found it by editing the SSL certificate. I should have another coffee ...
-