How do I redirect requests coming to https://blog.example.com to https://example.com/blog?
Reading the apache docs on when not to use the rewrite mod, I tried a simple redirect e.g.
Redirect https://blog.example.com https://example.com/blog
But when I visit https://blog.example.com, it doesn't redirect me. Only says error with a certificate. Is there any possibility to redirect HTTPS subdomain? It is working ok with HTTP when I use something like this:
<VirtualHost *:80>
ServerName blog.example.com
Redirect / https://example.com/blog/
</VirtualHost>
Conditions like these:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^\.]+)\.example\.com$
RewriteRule ^/(.*)$ https://example.com/%1/$1 [R=301,L]
Only work when using HTTP not HTTPS...
Thank you.