It appears the problem is with your first rule:
Redirect permanent / https://myhost.com/
Which could be changed to:
Redirect permanent http://myhost.com/ https://myhost.com/
Additionally, the regular expression doesn't seem to work unless it's inside quotes, so ^/$
should be changed to "^/$"
The second redirect is not observed because the first redirect occurs an infinite number of times.
I was able to debug this by adding a couple of entries to my /etc/hosts
file as follows:
127.0.0.1 kerneldeimos.local
127.0.0.1 subdomain.kerneldeimos.local
I then added your rewrite rules (using a subdomain instead of HTTPS for convenience):
Redirect permanent / http://subdomain.kerneldeimos.local
RedirectMatch "^/$" /sub-folder/
It worked after I changed my config to the following:
Redirect permanent http://kerneldeimos.local http://subdomain.kerneldeimos.local
RedirectMatch "^/$" /sub-folder/