I have a site link which is a CNAME from link , where the hosted site is hosted. But I needed to be redirected to the meusite
folder of my amazon machine, ie link , but keep it only visible link .
I got this with this answer: link
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 from http to https, that is, if I type link it will redirect to link you will need to go to the content link .
The certificate is in meusite.pt
.
Is it possible to do this with .htaccess
? How?
[EDIT]
I added the (commented) lines of the question that was indicated as a duplicate, but it is looped:
This webpage has a redirect loop