How to redirect HTTP to HTTPS in IBM HTTP Server or Apache HTTP Server
Redirect all traffic coming on port 80 to port 443.
Author(s): Tamas Bures | Created: 08 July 2019 | Last modified: 21 December 2024
Tested on: -
Redirect HTTP to HTTPS
-
Open the
<IHS/Apache install dir>/conf/httpd.conf
file with a text editor. -
Enable the
mod_rewrite.<so|dll>
by uncommenting the line:#LoadModule rewrite_module modules/mod_rewrite.<so|dll>
to
LoadModule rewrite_module modules/mod_rewrite.<so|dll>
-
Append the following configuration block to the end of the file.
RewriteEngine on RewriteCond %{SERVER_PORT} =80 RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,L]