locked Posted May 28, 2017 Share Posted May 28, 2017 I have an SSL certificate installed on my domain (both example.heliohost.org and example.tk, and variants), and would like to make it so that users going to http://example.tk are redirected to https://example.tk. I am currently using mod_rewrite inside .htaccess to make this work, but every post I can find on this online says this is a last resort and that using apache virtualhosts is much better. The problem is, I have no idea where the necessary apache configuration files are located, if I need to create them, or if I even have access to them. Or, should I use cPanel's redirects along with a wildcard instead? Some other method? Thanks for any help. Edit: Also, I'm on Ricky, if that helps. Quote Link to comment Share on other sites More sharing options...
Krydos Posted May 28, 2017 Share Posted May 28, 2017 Just use .htaccess. Even I don't really have access to virtualhosts. Cpanel gets very angry at me when I mess with httpd.conf. Quote Link to comment Share on other sites More sharing options...
locked Posted May 28, 2017 Author Share Posted May 28, 2017 Okay, thanks! My current .htaccess rule is below, does it look good to you? RewriteEngine OnRewriteCond %{HTTPS} !=onRewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] Quote Link to comment Share on other sites More sharing options...
Krydos Posted May 28, 2017 Share Posted May 28, 2017 That looks pretty close to what I use. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.