Skip to main content

301 Redirect http to https .htaccess code needed urgently

Comments

6 comments

  • cPanelMichael
    Hello :) Have you considered using the "Redirects" option in cPanel? Or, if you prefer to edit the .htaccess file directly, this post should help: Force use of SSL Thank you.
    0
  • mickeyb44
    Many thanks for your lightning fast reply ! I wish my shopping cart software sellers were the same as you. Are you saying I can do this: Open wordpad create empty file called .htaccess Paste this code: RewriteEngine on RewriteCond %{HTTP_HOST} ^yourwebsite\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.yourwebsite\.com$ RewriteRule ^(.*)$ "https\:\/\/yourwebsite\.com\/$1" [R=301,L] Upload to root directory on aso ? Is that all correct and 100% server friendly Michael [COLOR="silver">- - - Updated - - - Obviously putting my domain in not 'yourwebsite'
    0
  • cPanelMichael
    Yes, that is correct. However, note that if your script already uses custom Mod_Rewrite rules you may have to adjust them accordingly. Thank you.
    0
  • mickeyb44
    Many thanks, Does the cpanel redirect option work in the same way and is it as good and google friendly as the htaccess one ? Michael
    0
  • cPanelPeter cPanel Staff
    Hello, Yes, the cPanel redirect should work just fine and be "Google Friendly".
    0
  • mickeyb44
    Ok thanks, just signed up and in cpanel already. I have a few more questions, will search before posting. Michael
    0

Please sign in to leave a comment.