Novell Cool Solutions

Redirecting HTTP requests to HTTPS



By:

July 21, 2014 1:12 pm

Reads:757

Comments:0

Score:4

Print/PDF

Here’s how to redirect a request from http to https using Apache’s mod_redirect module in a cluster-configured Filr that is fronted by Apache.

Prerequisite: Apache should be SSL enabled.

For redirecting the request from http to https we need to use apache’s mod_redirect module.

By default, SUSE doesn’t enable the mod_rewrite module.

Follow these steps to install it.

Steps:

  • Edit the file /etc/sysconfig/apache2 as root
  • Locate the following line:

    APACHE_MODULES=

  • Then add the following lines:

    rewrite

    The end result should look similar to the following:

    APACHE_MODULES="authz_host actions alias auth_basic authz_groupfile authn_file authz_user autoindex cgi dir include log_config mime negotiation rewrite setenvif status userdir asis imagemap ssl reqtimeout authz_default proxy proxy_ajp proxy_balancer"
  • Save the changes and quit
  • run SUSEconfig to update the apache configuration files
  • run /etc/init.d/apache2 restart to restart the Apache server
  • Then for redirecting the http request to https add the following line in file etc/apache2/httpd.conf

    RewriteEngine On
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule !/status https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

  • Save the file
  • Restart the apache server
1 vote, average: 4.00 out of 51 vote, average: 4.00 out of 51 vote, average: 4.00 out of 51 vote, average: 4.00 out of 51 vote, average: 4.00 out of 5 (1 votes, average: 4.00 out of 5)
You need to be a registered member to rate this post.
Loading...Loading...

Tags: , ,
Categories: Filr, Technical

0

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS