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/mod_rewrite.so
and remove the # to uncomment
LoadModule rewrite_module modules/mod_rewrite.so
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, blogger.com won't let me post the correct syntax for the VirtualHost *:443, please see the image below for the correct syntax
FYI, blogger.com won't let me post the correct syntax for the VirtualHost *:443, please see the image below for the correct syntax
VirtualHost *:443
Servername lc.ozzyblogger.com
SSLEnable
/VirtualHost
/VirtualHost
and add two lines
VirtualHost *:443
Servername lc.ozzyblogger.com
SSLEnable
RewriteEngine on
RewriteRule ^/$ /homepage [R,L]
/VirtualHost
/VirtualHost
This will load the lc.theozzyblogger.com/homepage application when you type lc.ozzyblogger.com/ in the url btw lc.theozzyblogger.com is not a real website, just an example :)
Note:
^ 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
Note:
^ 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, blogger.com 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]
/VirtualHost
/VirtualHost
That will take care of any requests that are typed as http://lc.theozzyblogger.com and redirect / rewrite as https://lc.theozzyblogger.com/homepage
Here are the web pages used as reference:
Configuring the IBM HTTP Server for SSL
http://publib.boulder.ibm.com/infocenter/ltscnnct/v2r0/index.jsp?topic=/com.ibm.lc_2.0_IC/t_configure_ihs.html
Redirecting non-SSL (HTTP) requests to SSL (HTTPS) requests with IBM HTTP Server or Apache, and WebSphere Application Server
http://www-01.ibm.com/support/docview.wss?uid=swg21107738
IBM HTTP Server URL redirect and rewrite
http://publib.boulder.ibm.com/infocenter/wchelp/v5r6m1/index.jsp?topic=/com.ibm.commerce.esupport.doc/html/Configuration/swg21231659.html
http://publib.boulder.ibm.com/infocenter/wchelp/v5r6m1/index.jsp?topic=/com.ibm.commerce.esupport.doc/html/Configuration/swg21231659.html
After I make the changes in https.conf, I cannot start the IBM HTTP Server.
ReplyDelete