Reputation: 1
I have installed SSL certificates in my WAS 7.0 and pointed to IBM Http Server under httd.conf file. I have implemented the below rewrite mechanism also.But still unable to redirect from http request to https for specific context root applications.
Please suggest me.
implemented below lines under httpd.conf file.
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
<IfModule mod_ibm_ssl.c>
Listen 443
<VirtualHost *:443>
SSLEnable
SSLProtocolDisable SSLv2
ErrorLog logs/error_log
CustomLog logs/access_log common
RewriteEngine On
RewriteOptions Inherit
</VirtualHost>
</IfModule>
KeyFile "/IBM/HTTPServer/testSSL/testkey.kdb"
SSLStashFile "/IBM/HTTPServer/testSSL/testkey.sth"
RewriteEngine on
RewriteRule ^/testPOC/(.*)$ https://localhost/testPOC/$1
Upvotes: 0
Views: 2218
Reputation: 416
Like Eric stated the most likely answer is a VH for *:80 needing the RewriteRule. Another outside possibility would be the use of localhost for the host name. Make sure you haven't done something that causes the loopback to not be handled properly. You can always try the real host name or IP to make sure using localhost does not cause problems (hosts file, A load balancer using the loopback, etc). Use RewriteLog to verify rewrite was done. Also make sure plugin-cfg.xml is set up to recognize port 443. It might have an explicit host name:443 for a VH as opposed to *:443. Using localhost would not match in that case. If you have a Load Balancer in front of IHS, it might be doing SSL offloading and SSL never makes it to IHS for the problem context roots.
Upvotes: 0
Reputation: 17872
Config look OK. Perhaps you have an explicit *:80 virtualhost defined somewhere, in which case you need to put the mod_rewrite directives there instead.
Upvotes: 1