Tuesday, June 6, 2017

HTTPServer 8.0 HTTP Rewrite Configuration

Edit /opt/IBM/HTTPServer/conf/httpd.conf, and add below lines into it:

LoadModule rewrite_module modules/mod_rewrite.so

NameVirtualHost *:80

<VirtualHost *:80>
ServerName server1.goweekend.ca
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*)$ https://server1.goweekend.ca/$1 [R]
RewriteLogLevel 0
RewriteLog logs/server1_rewrite.log
</VirtualHost>

<VirtualHost *:80>
ServerName suzhou.goweekend.ca
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*)$ https://server2.goweekend.ca/$1 [R]
RewriteLogLevel 0
RewriteLog logs/server2_rewrite.log
</VirtualHost>

No comments:

Post a Comment