redirect apache subdomain to https

Discussion in 'Chit Chat' started by paul3200, May 27, 2015.

  1. paul3200

    paul3200 MDL Member

    Dec 3, 2010
    158
    10
    10
    #1 paul3200, May 27, 2015
    Last edited by a moderator: Apr 20, 2017
    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
     
  2. Skaendo

    Skaendo MDL Addicted

    Sep 23, 2014
    888
    529
    30
    #2 Skaendo, May 27, 2015
    Last edited: May 27, 2015
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...