How can i redirect a subdomain to https using apache2? I have tried using Redirect / https://sub.domain.com below is what i am using Code: <VirtualHost *:80> ServerAdmin webmaster@domain.com ServerName sub.domain.com ServerAlias www.sub.domain.com redirect / https://sub.domain.com </VirtualHost> but this forces domain.com to redirect to https://sub.domain.com instead of the default site how can i sort it out? i am running Ubuntu 14.04 64bit Server
Have you tried this: https://httpd.apache.org/docs/2.2/rewrite/avoid.html#redirect Or tried using mod_rewrite? I'm not fluent in apache, sorry I can't be of more help.