Is it possible to have two VirtualHost's, one for non-SSL and another for SSL?

Discussion in 'General' started by tensor, Jan 7, 2008.

  1. tensor

    tensor New Member

    I am trying to setup a separate web-site for mail web mail reading for my users. It has to be a
    I want all access to be through TLS/SSL. The problem is that i want to use roundcube in this installation. Later, some other packages would be added like SquirrelMail and others for my users to have a choice.
    I want to run these packages as unmodified as possible.
    The problem is that the contents of the site can be accessed through the regular clear text 80 port and the SSL/TLS protected 443 port.
    I want the user to be redirected from to automatically.

    I can manually configure two virtualhosts, one for http and another for https.
    Http version would have a RedirectMatch permanent directive. Like so

    RedirectMatch permanent ^/(.*)$$1

    #SSL and other stuff

    I want this site to manged by ISPConfig.
    Please suggest another method.
    Currently I am considering mod_rewrite for the task.
    Last edited: Jan 7, 2008
  2. tensor

    tensor New Member

    I have added these deirectives to "Apache Directives (Optional)" of site.

    RewriteEngine On
    RewriteCond %{HTTPS} ^off$
    RewriteRule ^/(.*)$$1 [R=permanent,L]

    This seems to have solved my problem.

    Are there any other solutions?

Share This Page