I have the current setup with Apache2, lets encrypt to move
http://domain.tld => https://domain.tld
http://www.domain.tld => https://www.domain.tld
Its working perfect,
Now I wanted move all my domainname visit to a subdir
http://domain.tld => https://domain.tld/subdir ( Done! its working )
But when I tried to redirect https domainName visit to subdir, I get multiple redirects.
https://domain.tld => https://domain.tld/subdir ( Endless redirect to
https://domain.tld/subdir/subdir/subdir/ and so on )
000-default-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost domain.tld:443>
ServerName domain.tld
ServerAlias www.domain.tld
DocumentRoot /var/www/domain.tld/html
Redirect permanent / https://domain.tld/abc
SSLCertificateFile /etc/letsencrypt/live/domain.tld/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.tld/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/domain.tld/chain.pem
</VirtualHost>
</IfModule>
000-default.conf
<VirtualHost domain.tld:80>
ServerName domain.tld
ServerAlias www.domain.tld
DocumentRoot /var/www/domain.tld/html
# This works like a charm !( DONE! )
Redirect 301 / https://domain.tld/roll-out/
# RewriteEngine on
# RewriteCond %{SERVER_NAME} =domain.tld [OR]
# RewriteCond %{SERVER_NAME} =www.domain.tld
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
I have commented the last 3 lines, Please help me understand why this happens and whats the solution.
Thanks a lot!