Quiet redirection from http to https on port 8080

Discussion in 'Tips/Tricks/Mods' started by platan, Jan 30, 2012.

  1. platan

    platan New Member

    SSL on port 8080
    Problem: Error 400: Bad Request - ... Hint: http://...:8080
    when http access. Terrible!

    A small trick will solve the problem.

    In a file: /etc/httpd/conf/sites-available/ispconfig.vhost add error document line before </VirtualHost>:
      SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
      ErrorDocument 400 "<script>document.location.href='https://[B][I]example.com[/I][/B]:8080/';</script><a href='https://[B][I]example.com[/I][/B]:8080/'>https://[B][I]example.com[/I][/B]:8080/</a>"
    1. Hostname (example.com) must be hardcoded. %{HOST_NAME} or something does not work.
    2. You must reenter ErrorDocument every time, You update Ispconfig3 system.

    Last edited: Jan 30, 2012
    Samo_slo likes this.
  2. Quijote Shin

    Quijote Shin New Member

    Simple and usefull!!
  3. Samo_slo

    Samo_slo Member

    Thanks it works! The file is located in /etc/apache2/sites-available/ispconfig.vhost
    Tomislav Aurednik likes this.

Share This Page