Skip to main content

Setting up redirection for https issue

Comments

7 comments

  • Dave Smith
    Hi, You could try undoing your changes above and uploading a .htaccess file containing the following (or enter the below in to your current .htaccess file at the top). RewriteEngine On RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not # the subsequent rule will catch it. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Now, rewrite any request to the wrong domain to use www. # [NC] is a case-insensitive match RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    See if that helps..?
    0
  • cPanelMichael
    Hello @G. Andore, I recommend trying the recommendation provided by @Dave Smith in the previous post, or trying an example like the one offered on the following thread: Thank you.
    0
  • Dan70
    thx!! works for me with SuiteCRM
    0
  • cPanelMichael
    Hello @Dan70, I'm glad to see the issue is now solved. Thanks for sharing the outcome!
    0
  • Dave Smith
    I can't take credit for the solution. Like many other solutions I came across it on
    0
  • G. Andore
    Hi, You could try undoing your changes above and uploading a .htaccess file containing the following (or enter the below in to your current .htaccess file at the top). RewriteEngine On RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not # the subsequent rule will catch it. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Now, rewrite any request to the wrong domain to use www. # [NC] is a case-insensitive match RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    See if that helps..?

    Hello @Dave Smith and @cPanelMichael I've tried doing what you did but it happened the same issue I mentioned above. ERR_TOO_MANY_REDIRECTS. Can you be so kind to take a look on the code I sent below took from my htaccess and let me know if something is wrong. Or should I replace the current values for the ones you've shared? RewriteEngine On RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not # the subsequent rule will catch it. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Now, rewrite any request to the wrong domain to use www. # [NC] is a case-insensitive match RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteOptions inherit # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
    0
  • cPanelMichael
    Hello @G. Andore, It looks like your WordPress redirect rules are conflicting with the forced HTTPS redirect. The following WordPress topic may help with this: Thank you.
    0

Please sign in to leave a comment.