Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

It is not possible to direct HTTPS to HTTP as that is redirecting secure traffic to less secure method, but the other way around is ok!

In your virtual host file:

...

https://askubuntu.com/questions/653923/force-https-and-www-with-virtual-host-apache2/653925#653925

No Format
<VirtualHost *:80>
    ServerName domainfreesoftwareservers.com
    ServerAlias *.domainfreesoftwareservers.com
    Redirect / https://domainwww.freesoftwareservers.com/
</VirtualHost>

<VirtualHost *:443>
  ServerName  Whatever You Usefreesoftwareservers.com
  Redirect / https://www.freesoftwareservers.com/
</VirtualHost >

<VirtualHost *:443>
  ServerName www.freesoftwareservers.com

###

</VirtualHost >

This all goes inside one virtual host file (sites-available)