HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=29)
-   -   Quiet redirection from http to https on port 8080 (http://www.howtoforge.com/forums/showthread.php?t=55996)

platan 30th January 2012 23:00

Quiet redirection from http to https on port 8080
 
Ispconfig3
Apache
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>:
Code:

  ...
  SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
  ErrorDocument 400 "<script>document.location.href='https://example.com:8080/';</script><a href='https://example.com:8080/'>https://example.com:8080/</a>"
 
</VirtualHost>

Attention:
  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.

Enjoy

Quijote Shin 18th March 2013 16:41

Simple and usefull!!


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

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