Howto::SSLRedirect

From Computer Science Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Introduction

CS Hosting uses SSL off loading (handled by the load balancers), so the apache service does not know if the end user is using SSL or not. Standard apache SSL redirection won't work, and will usually lead to an infinite loop.

.htaccess

Add the following the your .htaccess file to make the page automatically redirect to SSL.

  RewriteEngine On
  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]