Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 7th January 2008, 04:01
tensor tensor is offline
Member
 
Join Date: Jul 2007
Posts: 51
Thanks: 11
Thanked 9 Times in 6 Posts
Default Is it possible to have two VirtualHost's, one for non-SSL and another for SSL?

I am trying to setup a separate web-site for mail web mail reading for my users. It has to be a webmail.xxxx.com.
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 http://webmail.xxxx.com/abc/xzy to https://webmail.xxxx.com/abc/xyz automatically.

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

<VirtualHost webmail.xxxx.com:80>
ServerName webmail.xxxx.com
RedirectMatch permanent ^/(.*)$ https://webmail.xxxx.com/$1
</VirtualHost>

<VirtualHost webmail.xxxx.com:443>
#SSL and other stuff
</VirtualHost>


I want this site to manged by ISPConfig.
Please suggest another method.
Currently I am considering mod_rewrite for the task.

Last edited by tensor; 7th January 2008 at 04:08.
Reply With Quote
Sponsored Links
  #2  
Old 7th January 2008, 04:27
tensor tensor is offline
Member
 
Join Date: Jul 2007
Posts: 51
Thanks: 11
Thanked 9 Times in 6 Posts
 
Default

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

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

This seems to have solved my problem.

Are there any other solutions?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.