Setting up redirection for https issue
Hello Team,
I've created a redirection on my Cpanel as shown below on the pictures attached but I am getting the error below.
This page isn"t working
example.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS
I selected this on Cpanel:
My goal is that when anyone types
they got directly to
secured site and it's working good with SSL but I want to fix those 2 addresses. Thanks for the help!
Type: permanent 103
https?://(www.)?: example.com
Blank space on /
Redirects to: https://example.com
Redirect with or without www.
Selecting Wild Card Redirect.
My goal is that when anyone types
'example.com' or 'www.example.com'
they got directly to
https://example.com
secured site and it's working good with SSL but I want to fix those 2 addresses. Thanks for the help!
-
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 -
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 -
thx!! works for me with SuiteCRM 0 -
Hello @Dan70, I'm glad to see the issue is now solved. Thanks for sharing the outcome! 0 -
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 -
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.
Comments
7 comments