cPanel Redirects Options Analysis
Let's analyze what the following two interfaces have to offer:
[COLOR=rgb(0, 0, 0)]To: [COLOR=rgb(65, 168, 95)]
www. redirection NOTE: The rules defined here get written in the domain's .htaccess file.
- cPanel > Redirects > www. redirection
- cPanel > Domains > Force HTTPS Redirect
http://site.com/
http://www.site.com/
https://www.site.com/
[COLOR=rgb(0, 0, 0)]To: [COLOR=rgb(65, 168, 95)]
https://site.com/
www. redirection NOTE: The rules defined here get written in the domain's .htaccess file.
-
Only redirect with www.
RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-SSL} !on RewriteCond %{HTTP_HOST} ^www\.site\.com$ RewriteRule ^(.*)$ "https\:\/\/site\.com\/$1" [R=301,L]
Only red URLs are redirected:http://site.com/
[COLOR=rgb(184, 49, 47)]http://www.site.com/
[COLOR=rgb(0, 0, 0)] ==> [COLOR=rgb(65, 168, 95)]https://site.com/
https://www.site.com/
<== Why is this not redirected? -
Redirect with or without www.
RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-SSL} !on RewriteCond %{HTTP_HOST} ^site\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.site\.com$ RewriteRule ^(.*)$ "https\:\/\/site\.com\/$1" [R=301,L]
Only red URLs are redirected: [COLOR=rgb(184, 49, 47)]http://site.com/
[COLOR=rgb(0, 0, 0)] ==> [COLOR=rgb(65, 168, 95)]https://site.com/
[COLOR=rgb(184, 49, 47)]http://www.site.com/
[COLOR=rgb(0, 0, 0)] ==> [COLOR=rgb(65, 168, 95)]https://site.com/
https://www.site.com/
<== Why is this not redirected? -
Do Not Redirect www.
RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-SSL} !on RewriteCond %{HTTP_HOST} ^site\.com$ RewriteRule ^(.*)$ "https\:\/\/site\.com\/$1" [R=301,L]
Only red URLs are redirected: [COLOR=rgb(184, 49, 47)]http://site.com/
[COLOR=rgb(0, 0, 0)] ==> [COLOR=rgb(65, 168, 95)]https://site.com/
http://www.site.com/
https://www.site.com/
- Only red URLs are redirected:
[COLOR=rgb(184, 49, 47)]
http://site.com/
[COLOR=rgb(0, 0, 0)] ==> [COLOR=rgb(65, 168, 95)]https://site.com/
[COLOR=rgb(184, 49, 47)]http://www.site.com/
[COLOR=rgb(0, 0, 0)] ==> [COLOR=rgb(184, 49, 47)]https://www.site.com/
https://www.site.com/
- Move the "Force HTTPS Redirect" option to the "Redirects" interface as a part of one integral interface where they won't conflict.
- Make it possible to select multiple domains when creating a redirect in the "Redirects" interface. This would write rules in the user's root .htaccess or to VirtualHost in httpd.conf instead of the domains' root .htaccess.
-
Hey hey! Could you submit these as a feature request so I can have the correct team review those? 0 -
Thanks! 0
Please sign in to leave a comment.
Comments
3 comments