3
I have a website http://meusite.pt which is a CNAME of http://minhamaquina.amazon.com, where the hosted site is. Only that I needed it to be redirected to the folder meusite
from my Amazon machine, namely, http://minhamaquina.amazon.com/meusite, but only to remain visible http://meusite.pt.
I got that with this answer: https://stackoverflow.com/a/36972084
RewriteEngine on
#RewriteCond %{HTTPS} !=on
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{HTTP_HOST} ^(www.)?meusite.pt$
RewriteCond %{REQUEST_URI} !^/meusite/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /meusite/$1
RewriteCond %{HTTP_HOST} ^(www.)?meusite.pt$
RewriteRule ^(/)?$ meusite/ [L]
My problem now is that I also need to redirect http to https, that is if I type http://meusite.pt it will redirect to https://meusite.pt that will have to fetch the contents to http://minhamaquina.amazon.com/meusite.
The certificate is in meusite.pt
.
It is possible to do this with the .htaccess
? Like?
[EDIT]
I added the (commented) lines of the question that was indicated as duplicate, but is on loop:
This webpage has a loop redirect
Look at this http://answall.com/questions/175119/for%C3%A7ar-o-redirect-to-environment-https/175123#175123
– LocalHost
Possible duplicate of Redirect https website to http
– LocalHost
Let’s go continue this discussion in chat.
– Jorge B.