Skip to main content

http to https redirect

Comments

9 comments

  • cPanelMichael
    Hello, This is answered on the following thread: Tips for .htaccess Thank you.
    0
  • 'Giovanni
    Hello, This is answered on the following thread: Tips for .htaccess Thank you.


    RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.domain.com/$1 [R,L]
    i've used this one but it has no effect.
    0
  • cPanelMichael
    Hello, Try using the example on the following post: Force https question Thank you.
    0
  • 'Giovanni
    same, it wont work.
    0
  • cPanelMichael
    Hello, Could you post the contents of the .htaccess file you tried using, ensuring to replace real domain names with examples? Thank you.
    0
  • 'Giovanni
    my .htaccess was empty. i put the code that was specified in your links and replaced domain.com with my real domain. for now i've found a working solution:
    RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
    i'm not sure if this is correct but it gets the job done, it points all my non https with or without www to ssl with www.
    0
  • theluli
    [QUOTE="'Giovanni, post: 2505295, member: 103904">my .htaccess was empty. i put the code that was specified in your links and replaced domain.com with my real domain. for now i've found a working solution:
    RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
    i'm not sure if this is correct but it gets the job done, it points all my non https with or without www to ssl with www.
    Hi Giovanni Where you add this "domain" does has to be a real domain name and second, you need to add for all domains ?
    0
  • cPanelMichael
    Where you add this "domain" does has to be a real domain name and second, you need to add for all domains ?

    Hello @theluli, Yes, it should be a real domain name. You should only have to add it to the document root of the domain name you want redirected. Thank you.
    0
  • theluli
    Hello @theluli, Yes, it should be a real domain name. You should only have to add it to the document root of the domain name you want redirected. Thank you.

    Thanks man, that helped a lot
    0

Please sign in to leave a comment.