I have two domains loaded in my Plesk websites and domains section, the two domains are without www, so let´s say the two domains are:
example.com
example.es
When I redirect from example.es to example.com it is done but with http, not with https.
So, I decided to edit my .htaccess file with the follwing instructions:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
But my page is not loaded properly, because seeing the web inspector it creates an infinite loop of requests to my main page example.com.
Anyone knows some kind of solutions?
Try the following instead:
The connection between the load balancer and your application server is likely HTTP only, so the
HTTPSApache server variable is alwaysoff.(Test first with a 302 - temporary - redirect to avoid potential caching issues.)
Although if you are redirecting everything (ie.
example.es) toexample.comthen do something like the following instead:Assuming both domains point to the same document root then you don't need your redirect in Plesk, which will otherwise result in 2 redirects by the sound of it.