Wednesday, August 22, 2012

Lotus Connections / IBM HTTP Server (Apache) root directory redirect to application

When configuring Lotus Connections to use IBM HTTP server, it's always annoyed me that when typing in the URL minus an application, it takes me to an IBM HTTP server help screen. I've configured a redirect in Lotus Connections 2.5, however, I was unable to find my documentation. There are a few ways to accomplish this but I'm going to cover the one that works best for me. ( might not be the best solution for you ) So this post is how to configure a URL redirect / rewrite from the root / to an application ( /homepage ) in Lotus Connections using IBM HTTP server.

1. First, locate your httpd.conf file the IBM HTTP Server is using. to load the module for redirect / rewrite, locate the line that says 

#LoadModule rewrite_module modules/

and remove the # to uncomment

LoadModule rewrite_module modules/

2. Next, locate the line that says DocumentRoot

and place a # in front of the line to comment it out.

3. Next locate the VirtualHost *:443
FYI, won't let me post the correct syntax for the VirtualHost *:443, please see the image below for the correct syntax
VirtualHost *:443

and add two lines

VirtualHost *:443
RewriteEngine on
RewriteRule ^/$ /homepage [R,L]

This will load the application when you type in the url  btw is not a real website, just an example :)


^ is the beginning of the line 
$ is the end of the line 
. is any single character except new line 
* is zero or more of character

4. Last, create a virtualhost entry for all port 80 requests to redirect to SSL at the end of the file

FYI, won't let me post the correct syntax for the VirtualHost *:80, please see the image below for the correct syntax
VirtualHost *:80
RewriteEngine on
RewriteRule ^/$ /homepage [R,L]
# handy for seeing what's going on when the web server tries to redirect
#RewriteLog "C:/rwlog.txt"
#RewriteLogLevel 1
# if the port's not 443 (ssl)...
RewriteCond %{SERVER_PORT} !^443$
#...redirect it to the same page but make it SSL
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

That will take care of any requests that are typed as and redirect / rewrite as

Here are the web pages used as reference:

Configuring the IBM HTTP Server for SSL 
Redirecting non-SSL (HTTP) requests to SSL (HTTPS) requests with IBM HTTP Server or Apache, and WebSphere Application Server

1 comment:

  1. After I make the changes in https.conf, I cannot start the IBM HTTP Server.