Skip to main content

Can't get my site to redirect to https?

Comments

5 comments

  • LostNerd

    RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
    Pop that in /home/$username/public_html/.htaccess - That'll redirect any traffic on port 80 (HTTP) to HTTPS. :)
    0
  • opentoe

    RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
    Pop that in /home/$username/public_html/.htaccess - That'll redirect any traffic on port 80 (HTTP) to HTTPS. :)

    As I said this is what I get when I edit my .htaccess file with that. The webpage at
    0
  • opentoe
    As I said this is what I get when I edit my .htaccess file with that. The webpage at
    0
  • LostNerd
    Looks more like the script (I assume PHP) looks for whether you specify HTTP of HTTPS and then does a redirect dependent on the protocol in use. It ideally shouldn't touch your .htaccess :) Without posting your .htaccess file here, there was no way for me to know that the script I provided was what you had. It's always best to provide examples where possible. We can only help as far as the information that is provided. I'm glad you solved the problem.
    0
  • cPanelMichael
    EDIT: Well, I found out what the problem was. The installed front end program that was running had a check mark to use https or http and that wasn't checked. Soon as I checked https only it must have made some change in my htaccess file because now I can only access https now.

    Hello, I am happy to see the issue is now resolved. Thank you for updating us with the outcome.
    0

Please sign in to leave a comment.