Skip to main content

Apache redirection to SSL

Comments

4 comments

  • cPanelMichael
    [quote="jakeyg, post: 1723302">All the documentation says that i should use redirect as opposed to mod rewrite and i would like to as it seems cleaner.
    Hello :) Could you elaborate on what documentation you are referring to? You can use Mod_Rewrite rules in a .htaccess file or the "Redirects" option in cPanel if you want to redirect a website. If you do prefer to edit the VirtualHost, then you can follow the instructions in the following document: Modify Virtualhost Containers With Include Files Thank you.
    0
  • avonni
    Add this to your .htaccess file: RewriteEngine on RewriteCond %{HTTPS} !=on RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
    0
  • jakeyg
    Thanks for the responses. This is where i found the documentation solution is recommended because it is simpler and safer"
    0
  • cPanelMichael
    The document I provided will help you to modify the VirtualHost for an account, however the .htaccess rules are more commonly used. Thank you.
    0

Please sign in to leave a comment.