#1  
Old 19th May 2009, 23:34
Jürgen Jürgen is offline
Junior Member
 
Join Date: Jan 2008
Posts: 19
Thanks: 4
Thanked 0 Times in 0 Posts
Send a message via ICQ to Jürgen Send a message via Skype™ to Jürgen
Default Redirect HTTPS to HTTP

Hello,

I have a lot of domains running. All of these don't use any SSL certificate. So I would like to redirect all requests on https to the http page instead of showing an error.

Is that possible?

Thanks a lot
Reply With Quote
Sponsored Links
  #2  
Old 20th May 2009, 08:35
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

Well I am using mod_rewrite to redirect all http for a host to https, so this should work vice versa:

Code for http -> https
Quote:
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
Should do for https to http
Quote:
RewriteEngine On
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI} [L,R]
But keep in mind, that anyway all users will get the cert warning if it not fits a known CA, is invalid, does not fit the hostname etc. anyway. Only _after_ establishing the ssl conn the rewrite request will be processed.

Also this config needs to be done for every user (afaik you can not set those rewrite rules for all vhosts from a global base?!)
Reply With Quote
  #3  
Old 13th March 2012, 00:52
n0fx n0fx is offline
Member
 
Join Date: Apr 2006
Posts: 36
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Ben View Post
Well I am using mod_rewrite to redirect all http for a host to https, so this should work vice versa:

Code for http -> https


Should do for https to http


But keep in mind, that anyway all users will get the cert warning if it not fits a known CA, is invalid, does not fit the hostname etc. anyway. Only _after_ establishing the ssl conn the rewrite request will be processed.

Also this config needs to be done for every user (afaik you can not set those rewrite rules for all vhosts from a global base?!)

For the code above, do I edit it in the .htaccess file in the root to have my site go from https:// to http://?
Reply With Quote
  #4  
Old 13th March 2012, 10:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,478
Thanks: 813
Thanked 5,255 Times in 4,121 Posts
Default

Edit or add the .htaccess file which is in the web directory.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 13th March 2012, 18:47
n0fx n0fx is offline
Member
 
Join Date: Apr 2006
Posts: 36
Thanks: 3
Thanked 0 Times in 0 Posts
 
Default This is a weird issue with my server http crashes

Quote:
Originally Posted by till View Post
Edit or add the .htaccess file which is in the web directory.
I tried editing the /var/www/web1/.htaccess file but it doesn't work. I also found another directory that had the .htaccess file which was /var/www/www.mywebsite.com/web/.htaccess. I edited the /var/www/web1/.htaccess file first and I found out the file in /var/www/web/www.mywebsite.com/ also got modified with the same information?

When I added the code, it doesn't forward the user to the http:// part of the website. it would not load at all, it just times out. I just commented out the modification in the /var/www/web1/.htaccess file, since it didn't work.

I'm having this weird issue, when a user tries to load the https:// portion of the site (it's not setup with SSL at all, I had the user with SSL checked under their account in ISPconfig but never setup the SSL for it, there is no certificate installed), it crashes the http:// part of the site. What I mean is that I can't load the http:// part of the site anymore, it just times out on the browser.

The only way to get it back up and running is to manually reboot the server. I tried to restart the apache service with /etc/init.d/apache restart but it doesn't fix the problem. I can ping the external dns/ip name and it responds back with a ping but just doesn't answer the normal http:// requests.

My server is configured with two network cards, one has an internal IP address and the other is directly connected on the net (external ip). When the http:// part of my site crashes/stops responding, I can still access the ISPconfig webpage and when I type in the internal ip address in the browser, it loads up the message that says that it's a shared IP address.

Does anyone know why when sometime loads the https:// part of the site, it causes my non ssl http:// to stop loading?
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
ISPConfig: from http to https & from https to http Hans Tips/Tricks/Mods 13 12th March 2013 23:22
Can ISPConfig listen on http & https? spidie Installation/Configuration 2 31st July 2007 02:53
http redirect to https derfy Feature Requests 2 24th June 2006 21:04
redirect HTTP to HTTPS and reverse zone todvard Installation/Configuration 1 11th March 2006 10:45
redirect an application (egroupware) from http to https blackflag Installation/Configuration 13 21st February 2006 21:44


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


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