#1  
Old 9th January 2006, 11:42
erk erk is offline
Member
 
Join Date: Oct 2005
Location: Göteborg, Sweden
Posts: 41
Thanks: 0
Thanked 4 Times in 3 Posts
Default Pure https site

Hi!

I'm having a bit of trouble finding a way to make a vhost a https-only site.
When I activate SSL for a site I get a <IfModule mod_ssl.c><VirtualHost XX.XX.XX.XX:443> added to my vhosts_ispconfig.conf but the namebased virtualhost on port 80 is still there.
This site should not be accessed at all without https. Is there any way to go around it (short of manually hacking the ispconfig database which I suppose would work)?

Regards,

Erk
Reply With Quote
Sponsored Links
  #2  
Old 9th January 2006, 12:07
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,735
Thanks: 840
Thanked 5,596 Times in 4,407 Posts
Default

There are no https only sites in ISPConfig.

But maybe you can add an apache rewrite rule in the httpd directives field or in an .htaccess file that rewrites every request that arrives for http:// to https://
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 9th January 2006, 21:45
erk erk is offline
Member
 
Join Date: Oct 2005
Location: Göteborg, Sweden
Posts: 41
Thanks: 0
Thanked 4 Times in 3 Posts
 
Default

Ok.

Anyway, I thought I would post my solution to the problem here.

First I added
Quote:
Options +SymLinksIfOwnerMatch
to the virtual host. This is needed for the mod_rewrite to work.
(Adding this is optional when creating a site in Ispconfig but there doesn't seem to be a way of changing it later. Fortunately I'm not afraid to type some SQL by hand )
Then in the document root I added a .htaccess file with a rewrite rule to redirect any non-SSL request to the root of the https site.
The .htaccess file looks like this:
Quote:
RewriteEngine On

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME} [R=301,L]
This will redirect http://myserver.com/something/ to https://myserver.com.
I do this because my target directories ( /something/ in this example) requires authenticatiion and this seems to mess things up a bit so rewriting to the root is the clean way of doing it.
If you to redirect to https://myserver.com/something/ then use the following:
Quote:
RewriteEngine On

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
I hope this might be of some use to someone in the future.

//Erk
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
how i can open a web site hadisaadeh Installation/Configuration 10 20th January 2006 16:46
Removed site, but it is still there mromer General 2 21st December 2005 18:46
ISPConfig wiki site sabotaged repeatedly Azathoth General 2 20th December 2005 13:45
mx record not set up for new site + misc jmroth Installation/Configuration 8 25th September 2005 16:35
can't delete a site KenMcGinnis Installation/Configuration 2 14th August 2005 16:02


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


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