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

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 19th March 2010, 10:40
neutrino neutrino is offline
Member
 
Join Date: Oct 2008
Posts: 61
Thanks: 13
Thanked 9 Times in 8 Posts
Lightbulb http to https redirection

Hello,

I'm currently trying to redirect the url http://mail.server.com to https://mail.server.com

I've tried all the options in ISPCONFIG (no flag, R, L, RL) and none off them actually work, Firefox / IE / Opera, there is no browser that accepts the rewrite rule.

The code produced by ispconfig is the next one :

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mail.server.com [NC]
RewriteRule ^/(.*)$ https://mail.server.com/$1 [R,L]


What I want to do, is to replace the ISPconfig code with something that works like :

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]


Problem is, each time I'll perform a change on the site, my code will be erased by the standard ispconfig code.

How can I change this ? I suppose I have to change some master code of ISPconfig, but I don't really like that idea, because it always causes trouble when updating to a new version.

Can a fix be expected in a future version of ISPconfig maybe ?
Reply With Quote
Sponsored Links
  #2  
Old 19th March 2010, 10:44
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,070
Thanks: 826
Thanked 5,396 Times in 4,240 Posts
Default

Just add the lines:

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

in the apache directives field of the website settings and click on save.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following 2 Users Say Thank You to till For This Useful Post:
neutrino (19th March 2010), robertoshulze2257 (18th July 2014)
  #3  
Old 19th March 2010, 10:54
neutrino neutrino is offline
Member
 
Join Date: Oct 2008
Posts: 61
Thanks: 13
Thanked 9 Times in 8 Posts
Default

That works perfectly well, I forgot that option !

Thanks a lot till
Reply With Quote
The Following 2 Users Say Thank You to neutrino For This Useful Post:
bowlAltetle (24th July 2014), Williamsl (24th July 2014)
  #4  
Old 22nd May 2010, 23:14
DaRKNeSS666NL DaRKNeSS666NL is offline
HowtoForge Supporter
 
Join Date: Nov 2006
Posts: 207
Thanks: 17
Thanked 5 Times in 4 Posts
Default

Quote:
Originally Posted by till View Post
Just add the lines:

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

in the apache directives field of the website settings and click on save.
Does this work for all or must I chance something in those lines?
I want to use https://webmail.mydomain.com all the time somebody uses web-mail.
__________________
Updating my server to Debian Squeeze, so here I go again...
Reply With Quote
The Following 2 Users Say Thank You to DaRKNeSS666NL For This Useful Post:
bowlAltetle (24th July 2014), XRumerTest (19th July 2014)
  #5  
Old 23rd May 2010, 07:23
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,256
Thanks: 212
Thanked 648 Times in 294 Posts
Default

Quote:
Does this work for all or must I chance something in those lines?
Yes that works, and also:

Code:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
__________________
Hans

MrHostman | Master in managed hosting
Reply With Quote
The Following User Says Thank You to Hans For This Useful Post:
itsnedkeren (8th March 2011)
  #6  
Old 23rd May 2010, 09:53
DaRKNeSS666NL DaRKNeSS666NL is offline
HowtoForge Supporter
 
Join Date: Nov 2006
Posts: 207
Thanks: 17
Thanked 5 Times in 4 Posts
Default

Witch one is the preferred way to do it?
__________________
Updating my server to Debian Squeeze, so here I go again...
Reply With Quote
  #7  
Old 7th February 2013, 06:52
Unfaiir Unfaiir is offline
HowtoForge Supporter
 
Join Date: Jul 2012
Location: Orange County, CA, USA
Posts: 43
Thanks: 14
Thanked 4 Times in 2 Posts
Question Feature Request: ModRewrite Is Not Optimal For This

Is there any chance that the option to make a whole site SSL only can be added to ISPConfig 3 in a future release?

Having this written into the vhost file is not only the "proper" way to do it but also would be a performance gain:

Code:
<VirtualHost *:80>
   ServerName www.example.com
   Redirect permanent / https://example.com
</VirtualHost>
__________________
We are not equal
Reply With Quote
  #8  
Old 7th February 2013, 10:23
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,070
Thanks: 826
Thanked 5,396 Times in 4,240 Posts
Default

No need to edit or create a vhost file as you can do this from within ispconfig. Go to the sites module, edit the website and go to the options tab and enter the following lines in the apache directives field:

Code:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
and press save.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
Williamsl (24th July 2014)
  #9  
Old 7th February 2013, 12:13
Unfaiir Unfaiir is offline
HowtoForge Supporter
 
Join Date: Jul 2012
Location: Orange County, CA, USA
Posts: 43
Thanks: 14
Thanked 4 Times in 2 Posts
Cool

That works too.

I wasn't suggesting that anyone modify the vhost directly I'm just making a feature request for a site option that basically says "Hey ISPConfig, I want this entire site to be SSL only".

Having that option would allow ISPConfig to then automatically write that very simple *:80 vhost entry, which not only handles the SSL only part, but also eliminates a full fledged *:80 vhost entry that never gets used but still has to get loaded into memory. This would also eliminate any need for adding any redirects by the user.

Not a crucial feature request or anything, but it would be nice.
__________________
We are not equal
Reply With Quote
The Following 3 Users Say Thank You to Unfaiir For This Useful Post:
bowlAltetle (26th July 2014), lovendo (16th July 2014), Williamsl (24th July 2014)
  #10  
Old 16th July 2014, 13:05
lovendo lovendo is offline
Junior Member
 
Join Date: Jan 2014
Posts: 16
Thanks: 2
Thanked 2 Times in 2 Posts
 
Default

Quote:
Originally Posted by Unfaiir View Post
That works too.

I wasn't suggesting that anyone modify the vhost directly I'm just making a feature request for a site option that basically says "Hey ISPConfig, I want this entire site to be SSL only".

Having that option would allow ISPConfig to then automatically write that very simple *:80 vhost entry, which not only handles the SSL only part, but also eliminates a full fledged *:80 vhost entry that never gets used but still has to get loaded into memory. This would also eliminate any need for adding any redirects by the user.

Not a crucial feature request or anything, but it would be nice.
Up, that's a really good request. Any news?
Reply With Quote
The Following User Says Thank You to lovendo For This Useful Post:
bowlAltetle (26th July 2014)
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig: from http to https & from https to http Hans Tips/Tricks/Mods 13 12th March 2013 23:22
change from http to https meth Installation/Configuration 1 5th October 2009 16:44
Can ISPConfig listen on http & https? spidie Installation/Configuration 2 31st July 2007 02:53
http to https redirection for port 81 - ISPConfig TheMaximumWeasel Installation/Configuration 6 30th May 2007 23:30
http redirect to https derfy Feature Requests 2 24th June 2006 21:04


All times are GMT +2. The time now is 07:00.


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