Auto forward https:// requests to http:// site (SSL to non SSL)

Discussion in 'Installation/Configuration' started by n0fx, Mar 13, 2012.

  1. n0fx

    n0fx New Member

    I have ISPconfig 2 setup but no SSL on my site and no certificate installed on my server. There is only one site on the server but I need to forward all HTTPS requests to the HTTP site.

    I read another thread on using mod_rewrite to do it but I was wondering how to do I use mod_rewrite to do it? Do I need to modify the .htaccess file in the root to do this?

    Thanks!
     
  2. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

  3. n0fx

    n0fx New Member

    That's for http -> https. I'm trying to do https -> http. For the webserver that I setup, the users want the site forwarded from https requests to the regular http site. SSL hasn't been setup on the server for the default site. There is only one site on the ISPconfig server right now.
     
  4. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Try
    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} on
    RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
     
  5. n0fx

    n0fx New Member

    Thanks, do I need to enable SSL and get a certificate before I can do the mod_rewrite? I tried the other code I posted before but it doesn't work, so I had a feeling I needed to enable SSL and get a certificate before I can forward requests to the http:// part of the site?
     
  6. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Apache cannot handle SSL requests if you don't enable SSL, so yes, you must enable it.
     
  7. n0fx

    n0fx New Member

    That's what I thought but had to double check, thanks :)
     

Share This Page