force website to https

Discussion in 'Installation/Configuration' started by muekno, Nov 15, 2015.

  1. muekno

    muekno Active Member HowtoForge Supporter

  2. ressel

    ressel Member

    Yes with rewrite for either apache or nginx
     
  3. muekno

    muekno Active Member HowtoForge Supporter

    @ressel Thanks, but can you give me a sample or URL to a sample
    is ist configurable in ispconfig contol pannel or habe I go to the appache conf files
    Thank you for clearing

    Rainer
     
  4. ressel

    ressel Member

    Hello,
    For Nginx I put following to nginx directives in ispconfig for each site:
    Code:
    if ($scheme != "https") {
         rewrite ^ https://$host$request_uri permanent;
    }
    For apache I have used following:
    Code:
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R] 
     
  5. muekno

    muekno Active Member HowtoForge Supporter

    It works thank you very much :)

    Rainer
     

Share This Page